56 lines
1.8 KiB
YAML
56 lines
1.8 KiB
YAML
|
|
version: '3.8'
|
||
|
|
|
||
|
|
services:
|
||
|
|
app:
|
||
|
|
build:
|
||
|
|
context: .
|
||
|
|
dockerfile: Dockerfile
|
||
|
|
container_name: pinnacle_app
|
||
|
|
restart: always
|
||
|
|
environment:
|
||
|
|
- PORT=3000
|
||
|
|
- NODE_ENV=production
|
||
|
|
- DATABASE_URL=postgres://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres_password}@postgres:5432/${POSTGRES_DB:-pinnacle_db}
|
||
|
|
- POSTGRES_HOST=postgres
|
||
|
|
- POSTGRES_PORT=5432
|
||
|
|
- POSTGRES_USER=${POSTGRES_USER:-postgres}
|
||
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres_password}
|
||
|
|
- POSTGRES_DB=${POSTGRES_DB:-pinnacle_db}
|
||
|
|
- SECRET_KEY=${SECRET_KEY:-pinnacle_secret_token_change_in_production}
|
||
|
|
- APP_URL=${APP_URL:-http://localhost:3000}
|
||
|
|
ports:
|
||
|
|
- "3000:3000"
|
||
|
|
depends_on:
|
||
|
|
postgres:
|
||
|
|
condition: service_healthy
|
||
|
|
labels:
|
||
|
|
- "traefik.enable=true"
|
||
|
|
- "traefik.http.routers.pinnacle-app.rule=Host(`${TRAEFIK_HOST:-localhost}`)"
|
||
|
|
- "traefik.http.routers.pinnacle-app.entrypoints=websecure"
|
||
|
|
- "traefik.http.routers.pinnacle-app.tls=true"
|
||
|
|
- "traefik.http.routers.pinnacle-app.tls.certresolver=letsencrypt"
|
||
|
|
- "traefik.http.services.pinnacle-app.loadbalancer.server.port=3000"
|
||
|
|
|
||
|
|
postgres:
|
||
|
|
image: postgres:16-alpine
|
||
|
|
container_name: pinnacle_postgres
|
||
|
|
restart: always
|
||
|
|
environment:
|
||
|
|
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
||
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres_password}
|
||
|
|
POSTGRES_DB: ${POSTGRES_DB:-pinnacle_db}
|
||
|
|
volumes:
|
||
|
|
- postgres_data:/var/lib/postgresql/data
|
||
|
|
- ./schema.sql:/docker-entrypoint-initdb.d/01-schema.sql
|
||
|
|
ports:
|
||
|
|
- "5432:5432"
|
||
|
|
healthcheck:
|
||
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-pinnacle_db}"]
|
||
|
|
interval: 5s
|
||
|
|
timeout: 5s
|
||
|
|
retries: 5
|
||
|
|
|
||
|
|
volumes:
|
||
|
|
postgres_data:
|
||
|
|
driver: local
|