This repository has been archived on 2026-05-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
app/docker-compose.yml
Flea Flicker c12935de9c
CI / Test (push) Successful in 28s
CI / Lint & Typecheck (push) Successful in 31s
CI / E2E Tests (push) Failing after 53s
CI / Build & Push Docker Images (push) Has been skipped
CI / Update Infra Image Tags (push) Has been skipped
CI / Build (push) Successful in 31s
CI / Web E2E (Dev) (push) Has been cancelled
CI / Deploy PR to groombook-dev (push) Has been cancelled
fix(docker): add healthcheck + depends_on condition on web service
Previously web started immediately after the api container launched, not
after it was ready. Playwright tests then hit the web server before the
nginx process had fully started, causing connection refused errors.

Now:
- api has a 30s startup grace via start_period and 20 retries
- web waits for api to be healthy (not just started)
- both services verify readiness before dependent steps proceed

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-21 21:09:44 +00:00

73 lines
1.6 KiB
YAML

services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: groombook
POSTGRES_USER: groombook
POSTGRES_PASSWORD: groombook
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U groombook"]
interval: 5s
timeout: 5s
retries: 5
migrate:
build:
context: .
dockerfile: apps/api/Dockerfile
target: migrate
environment:
DATABASE_URL: postgres://groombook:groombook@postgres:5432/groombook
depends_on:
postgres:
condition: service_healthy
restart: "no"
api:
build:
context: .
dockerfile: apps/api/Dockerfile
ports:
- "3000:3000"
environment:
DATABASE_URL: postgres://groombook:groombook@postgres:5432/groombook
AUTH_DISABLED: "true"
CORS_ORIGIN: http://localhost:8080
PORT: "3000"
depends_on:
postgres:
condition: service_healthy
migrate:
condition: service_completed_successfully
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3000/health || exit 1"]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s
web:
build:
context: .
dockerfile: apps/web/Dockerfile
ports:
- "8080:80"
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
api:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:80 || exit 1"]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s
volumes:
postgres_data: