-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat(pg): added ability to customize postgres port when running containerized app #1173
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,8 +9,8 @@ services: | |||||
| command: sleep infinity | ||||||
| environment: | ||||||
| - NODE_ENV=development | ||||||
| - DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio | ||||||
| - POSTGRES_URL=postgresql://postgres:postgres@db:5432/simstudio | ||||||
| - DATABASE_URL=postgresql://postgres:postgres@db:${POSTGRES_PORT:-5432}/simstudio | ||||||
| - POSTGRES_URL=postgresql://postgres:postgres@db:${POSTGRES_PORT:-5432}/simstudio | ||||||
| - BETTER_AUTH_URL=http://localhost:3000 | ||||||
| - NEXT_PUBLIC_APP_URL=http://localhost:3000 | ||||||
| - BUN_INSTALL_CACHE_DIR=/home/bun/.bun/cache | ||||||
|
|
@@ -39,7 +39,7 @@ services: | |||||
| command: sleep infinity | ||||||
| environment: | ||||||
| - NODE_ENV=development | ||||||
| - DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio | ||||||
| - DATABASE_URL=postgresql://postgres:postgres@db:${POSTGRES_PORT:-5432}/simstudio | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: Same issue here - POSTGRES_PORT variable is incorrectly used in hostname position instead of port
Suggested change
|
||||||
| - BETTER_AUTH_URL=http://localhost:3000 | ||||||
| - NEXT_PUBLIC_APP_URL=http://localhost:3000 | ||||||
| depends_on: | ||||||
|
|
@@ -60,7 +60,7 @@ services: | |||||
| context: .. | ||||||
| dockerfile: docker/db.Dockerfile | ||||||
| environment: | ||||||
| - DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio | ||||||
| - DATABASE_URL=postgresql://postgres:postgres@db:${POSTGRES_PORT:-5432}/simstudio | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: POSTGRES_PORT variable incorrectly positioned in database URL - will break migrations when custom port is used
Suggested change
|
||||||
| depends_on: | ||||||
| db: | ||||||
| condition: service_healthy | ||||||
|
|
@@ -77,7 +77,7 @@ services: | |||||
| - POSTGRES_PASSWORD=postgres | ||||||
| - POSTGRES_DB=simstudio | ||||||
| ports: | ||||||
| - "5432:5432" | ||||||
| - "${POSTGRES_PORT:-5432}:5432" | ||||||
| healthcheck: | ||||||
| test: ["CMD-SHELL", "pg_isready -U postgres"] | ||||||
| interval: 5s | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Critical error:
${POSTGRES_PORT:-5432}is placed in the hostname position instead of port position. Should bepostgresql://postgres:postgres@db:5432/simstudiosince the container always uses internal port 5432