Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Compose to define externally accessible resources as Docker Compose services #367

Open
robertlagrant opened this issue Jun 14, 2023 · 0 comments

Comments

@robertlagrant
Copy link

What is the problem you're trying to solve
Have Compose manage interaction with ports on the local machine, and on remote ports as well.

Describe the solution you'd like
Be able to define services that are mappings to url (including localhost) and to one or more ports on that URL. I'd like to not have to need to worry about the correct networking mode to access ports, e.g. on a locally running service.

For example, say I have a locally running Postgres on my machine. I don't want to make a Postgres Docker container, as it's inefficient and managing state with Docker can be a small mental overhead. Instead of working out the correct networking mode, I'd love to be able to say something like the following:

services:
    my_app:
        image: my_local_image
        environment:
            POSTGRES_HOSTNAME: my_local_postgres
            POSTGRES_PORT: 5432
            POSTGRES_USER: postgres
            POSTGRES_PASS: postgres

    my_local_postgres:
        hostname: localhost
        allowed_ports:
            - 5432

Another similar use case might be in something like GitLab CI/CD, where using their services concept alongside tests running in Docker Compose is currently difficult. Being able to easily break out of Docker Compose to a local port word be helpful.

Finally, this would be great for production deployments re: security. Having a local-only network whose exits are explicitly defined would make standardisation of tooling that inspects said exits much simpler.

@robertlagrant robertlagrant changed the title Allow Compose to define externally accessible resources as internal services Allow Compose to define externally accessible resources as Docker Compose services Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant