fix(docker): make host ports configurable via WEB_PORT and DB_PORT

This commit is contained in:
JobsBoard Deployer 2026-09-05 11:34:36 -04:00
parent 86ea1c83d6
commit 00775c48ed
2 changed files with 7 additions and 5 deletions

View file

@ -8,7 +8,9 @@ POSTGRES_PASSWORD=replace_with_a_secure_password
POSTGRES_DB=jobsboard
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_URL=http://localhost:3000
NODE_ENV=production

View file

@ -10,7 +10,7 @@ services:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: jobsboard
ports:
- "5432:5432"
- "${DB_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
@ -26,11 +26,11 @@ services:
container_name: jobsboard_web
restart: always
ports:
- "3000:3000"
- "${WEB_PORT:-3000}:3000"
environment:
DATABASE_URL: "postgresql://postgres:postgres@db:5432/jobsboard?schema=public"
NEXTAUTH_SECRET: "jobsboard-secret-key-for-auth-sessions"
NEXTAUTH_URL: "http://localhost:3000"
NEXTAUTH_SECRET: "${NEXTAUTH_SECRET:-jobsboard-secret-key-for-auth-sessions}"
NEXTAUTH_URL: "${NEXTAUTH_URL:-http://localhost:3000}"
NODE_ENV: "production"
depends_on:
db: