services: postgres: image: postgres:16-alpine container_name: no-whatever-db ports: - "5432:5432" environment: POSTGRES_USER: nowhatever POSTGRES_PASSWORD: nowhatever POSTGRES_DB: nowhatever volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U nowhatever"] interval: 5s timeout: 3s retries: 5 restart: unless-stopped networks: - nginx app: build: . image: no-whatever:latest container_name: no-whatever ports: - "3000:3000" environment: - DATABASE_URL=postgresql://nowhatever:nowhatever@postgres:5432/nowhatever depends_on: postgres: condition: service_healthy restart: unless-stopped networks: - nginx volumes: pgdata: networks: nginx: external: true