fix(docker): make host ports configurable via WEB_PORT and DB_PORT
This commit is contained in:
parent
86ea1c83d6
commit
00775c48ed
2 changed files with 7 additions and 5 deletions
|
|
@ -8,7 +8,9 @@ POSTGRES_PASSWORD=replace_with_a_secure_password
|
||||||
POSTGRES_DB=jobsboard
|
POSTGRES_DB=jobsboard
|
||||||
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
|
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
|
||||||
|
|
||||||
# Application URLs & Authentication
|
# Application URLs, Ports & Authentication
|
||||||
|
WEB_PORT=3000
|
||||||
|
DB_PORT=5432
|
||||||
NEXTAUTH_SECRET=replace_with_a_random_32_char_secret_string
|
NEXTAUTH_SECRET=replace_with_a_random_32_char_secret_string
|
||||||
NEXTAUTH_URL=http://localhost:3000
|
NEXTAUTH_URL=http://localhost:3000
|
||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ services:
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
POSTGRES_DB: jobsboard
|
POSTGRES_DB: jobsboard
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "${DB_PORT:-5432}:5432"
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
|
|
@ -26,11 +26,11 @@ services:
|
||||||
container_name: jobsboard_web
|
container_name: jobsboard_web
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "${WEB_PORT:-3000}:3000"
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: "postgresql://postgres:postgres@db:5432/jobsboard?schema=public"
|
DATABASE_URL: "postgresql://postgres:postgres@db:5432/jobsboard?schema=public"
|
||||||
NEXTAUTH_SECRET: "jobsboard-secret-key-for-auth-sessions"
|
NEXTAUTH_SECRET: "${NEXTAUTH_SECRET:-jobsboard-secret-key-for-auth-sessions}"
|
||||||
NEXTAUTH_URL: "http://localhost:3000"
|
NEXTAUTH_URL: "${NEXTAUTH_URL:-http://localhost:3000}"
|
||||||
NODE_ENV: "production"
|
NODE_ENV: "production"
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue