services: app: build: context: . dockerfile: Dockerfile args: - NEXT_PUBLIC_VAPID_PUBLIC_KEY=BEFs_VtoxY7SpNnd-ubz1ioliESlRI4sY6ny7Qp3rm7V1cm0gqyZX8TAHp4AaQ81yKC4LfWtJFQz_aHc25G-Tww container_name: nextstep-app restart: unless-stopped ports: - "4678:3000" # Bind to all interfaces for Tailscale access environment: - DATABASE_URL=postgresql://nextstep:${DB_PASSWORD:-nextstep}@db:5432/nextstep?schema=public - NEXTAUTH_SECRET=${NEXTAUTH_SECRET} - NEXT_PUBLIC_APP_URL=https://debianvm.kangaroo-eel.ts.net:10000 - TZ=Australia/Perth - NODE_ENV=production # Push notification VAPID keys - NEXT_PUBLIC_VAPID_PUBLIC_KEY=BEFs_VtoxY7SpNnd-ubz1ioliESlRI4sY6ny7Qp3rm7V1cm0gqyZX8TAHp4AaQ81yKC4LfWtJFQz_aHc25G-Tww - VAPID_PRIVATE_KEY=KgVQVO7XhfCklrJ3o9wowzK90AxI6Exg9pXPq76Qx4A - VAPID_EMAIL=mailto:admin@nextstep.local depends_on: db: condition: service_healthy networks: - nextstep-network healthcheck: test: ["CMD", "wget", "-qO-", "http://localhost:3000/api/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s scheduler: image: alpine restart: unless-stopped depends_on: app: condition: service_healthy entrypoint: /bin/sh command: > -c "apk add --no-cache curl && while true; do echo 'Triggering notification check...' && curl -s -X POST http://app:3000/api/notifications/send && echo '' && sleep 60; done" networks: - nextstep-network db: image: postgres:16-alpine container_name: nextstep-db restart: unless-stopped environment: - POSTGRES_USER=nextstep - POSTGRES_PASSWORD=${DB_PASSWORD:-nextstep} - POSTGRES_DB=nextstep - TZ=Australia/Perth - PGTZ=Australia/Perth volumes: - postgres_data:/var/lib/postgresql/data networks: - nextstep-network healthcheck: test: ["CMD-SHELL", "pg_isready -U nextstep -d nextstep"] interval: 10s timeout: 5s retries: 5 start_period: 10s # Expose PostgreSQL to localhost for migrations ports: - "127.0.0.1:5432:5432" volumes: postgres_data: name: nextstep-postgres-data networks: nextstep-network: name: nextstep-network driver: bridge