sandbox-notebookllamalm-nextjs/docker-compose.yml
Vadym Samoilenko 954e05e01e Fix docker compose up blocking on frontend healthcheck
- frontend depends_on: service_started (not service_healthy) — docker compose
  up -d now returns once containers start, not after full health chain resolves
- frontend healthcheck: use node HTTP check (wget/curl not in alpine runner)
- start_period: 60s (Next.js can take time on first request)
- on_error: show 60 log lines instead of 30

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 14:57:12 +01:00

110 lines
2.7 KiB
YAML

services:
postgres:
image: postgres:18
container_name: sandbox-nextjs-postgres
ports:
- "5433:5432"
environment:
POSTGRES_DB: postgres_nextjs
POSTGRES_USER: postgres
POSTGRES_PASSWORD: admin
volumes:
- pgdata_nextjs:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres_nextjs"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
redis:
image: redis:7-alpine
container_name: sandbox-nextjs-redis
ports:
- "6380:6379"
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
start_period: 5s
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: sandbox-nextjs-backend
ports:
- "9000:9000"
env_file:
- ./backend/.env
environment:
PODCAST_DATA_DIR: conversations
pgql_host: postgres
pgql_port: "5432"
volumes:
- podcasts_data:/app/conversations
- uploads_data:/app/failed_uploads
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:9000/api/health || exit 1"]
interval: 15s
timeout: 10s
retries: 5
start_period: 30s
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: sandbox-nextjs-frontend
ports:
- "4000:4000"
environment:
NODE_ENV: production
PORT: "4000"
NEXT_PUBLIC_API_URL: "https://ai-sandbox.oliver.solutions/notebookllama-back"
NEXT_PUBLIC_WS_URL: "wss://ai-sandbox.oliver.solutions/notebookllama-back"
depends_on:
backend:
condition: service_started
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:4000/notebookllama', r => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))\""]
interval: 20s
timeout: 10s
retries: 5
start_period: 60s
jaeger:
image: jaegertracing/all-in-one:latest
container_name: sandbox-nextjs-jaeger
ports:
- "17000:16686"
- "14317:4317"
- "14318:4318"
environment:
- COLLECTOR_ZIPKIN_HOST_PORT=:9411
restart: unless-stopped
adminer:
image: adminer
container_name: sandbox-nextjs-adminer
ports:
- "9001:8080"
restart: unless-stopped
volumes:
pgdata_nextjs:
redis_data:
podcasts_data:
uploads_data: