services: postgres: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_DB: xbid POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 networks: - xbid # One-off migration runner, applied by the deploy workflow before the app # comes up. It builds from the Dockerfile's `builder` stage because the # production image ships runtime dependencies only -- the Prisma CLI and its # engines are devDependencies and are not in the standalone bundle. # # Behind a profile so `docker compose up` never starts it; the deploy targets # it explicitly with `docker compose run --rm migrate`. migrate: build: context: . dockerfile: Dockerfile target: builder environment: DATABASE_URL: postgresql://postgres:postgres@postgres:5432/xbid command: ["npx", "prisma", "migrate", "deploy"] depends_on: postgres: condition: service_healthy networks: - xbid profiles: - tools app: build: context: . dockerfile: Dockerfile restart: unless-stopped environment: DATABASE_URL: postgresql://postgres:postgres@postgres:5432/xbid NEXTAUTH_SECRET: hZTKvtZtchjbJulsVE8Kf5YPLibR619JoK/z7vO2i/s= NEXTAUTH_URL: https://xbid.twotalesvfx.com SHOTS_API_KEY: ${SHOTS_API_KEY:?SHOTS_API_KEY must be set in the .env file next to docker-compose.yml} depends_on: postgres: condition: service_healthy networks: - xbid - npm_default volumes: postgres_data: networks: xbid: npm_default: external: true