services: postgres: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: anouma ports: - "5432:5432" volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 10 # Optional: run the Next.js app in Docker too. For local development it's # usually simpler to run `npm run dev` on the host against the Postgres # container above (DATABASE_URI host: 127.0.0.1, as in .env.example). # To run the whole stack in Docker instead, uncomment this service and set # DATABASE_URI's host to `postgres` (the service name) in your .env file. # app: # build: . # restart: unless-stopped # ports: # - "3000:3000" # env_file: # - .env # depends_on: # postgres: # condition: service_healthy volumes: pgdata: