Allow configurable PostgreSQL credentials and synchronize DATABASE_URL across containers
This commit is contained in:
parent
95238d0c31
commit
c7031643ce
1 changed files with 6 additions and 6 deletions
|
|
@ -6,15 +6,15 @@ services:
|
|||
container_name: jobsboard_db
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: jobsboard
|
||||
POSTGRES_USER: "${POSTGRES_USER:-postgres}"
|
||||
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-postgres}"
|
||||
POSTGRES_DB: "${POSTGRES_DB:-jobsboard}"
|
||||
ports:
|
||||
- "${DB_PORT:-5432}:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres -d jobsboard"]
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-jobsboard}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
|
@ -31,7 +31,7 @@ services:
|
|||
ports:
|
||||
- "${WEB_PORT:-3000}:3000"
|
||||
environment:
|
||||
DATABASE_URL: "postgresql://postgres:postgres@db:5432/jobsboard?schema=public"
|
||||
DATABASE_URL: "${DATABASE_URL:-postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@db:5432/${POSTGRES_DB:-jobsboard}?schema=public}"
|
||||
NEXTAUTH_SECRET: "${NEXTAUTH_SECRET:-jobsboard-secret-key-for-auth-sessions}"
|
||||
NEXTAUTH_URL: "${NEXTAUTH_URL:-http://localhost:3000}"
|
||||
NODE_ENV: "production"
|
||||
|
|
@ -52,7 +52,7 @@ services:
|
|||
container_name: jobsboard_scraper
|
||||
restart: always
|
||||
environment:
|
||||
DATABASE_URL: "postgresql://postgres:postgres@db:5432/jobsboard?schema=public"
|
||||
DATABASE_URL: "${DATABASE_URL:-postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@db:5432/${POSTGRES_DB:-jobsboard}?schema=public}"
|
||||
SCRAPE_INTERVAL_MINUTES: "30"
|
||||
SOCKS5_PROXY: "${SOCKS5_PROXY:-}"
|
||||
PROXY_URL: "${PROXY_URL:-}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue