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

Choose non-default port for Postgres in docker/up.sh #1956

Closed
rossturk opened this issue Apr 19, 2022 · 3 comments · Fixed by #2000
Closed

Choose non-default port for Postgres in docker/up.sh #1956

rossturk opened this issue Apr 19, 2022 · 3 comments · Fixed by #2000
Labels
feature good first issue Good for newcomers
Milestone

Comments

@rossturk
Copy link
Collaborator

I keep running into situations where I want to run Marquez alongside Airflow (or another system that also runs a Postgres database) and the two docker-compose environments both attempt to start a Postgres database. The "correct" workaround is to create a single docker-compose environment with a shared database for both systems, but this is not always ideal.

It would be nice if we could tell docker/up.sh to start Postgres on an alternate port.

@rossturk rossturk added good first issue Good for newcomers feature labels Apr 19, 2022
@collado-mike
Copy link
Collaborator

TBH, there's not a lot of reason to map the database port to any specific port on the host. The Marquez API will get routed by Docker to whatever port it's actually bound to. The only useful thing we get out of mapping to a specific port is that we can use psql on the command line to query the database during development. docker port marquez-db 5432 is all we really need to find what port to connect to, though

@rossturk
Copy link
Collaborator Author

It's not about accessing the DB, it's about other tools complaining that they can't start their own databases because the port is in use.

@collado-mike
Copy link
Collaborator

Yeah, I got it. I'm saying there will be no conflicts if we bind 5432 to a random port (if we change this line to just 5432 instead of 5432:5432).

The API container will still be able to hit the database because docker magic will translate db:5432 to whatever actual port it's bound to. Only commands outside the docker network will have problems (i.e., psql on the command line), but that can be addressed with the docker port command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature good first issue Good for newcomers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants