services: postgres: image: postgres:16-alpine environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: thoughts ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 nats: image: nats:2-alpine ports: - "4222:4222" - "8222:8222" # monitoring endpoint command: ["--jetstream", "--http_port", "8222"] api: build: . ports: - "8000:8000" environment: DATABASE_URL: postgres://postgres:postgres@postgres:5432/thoughts JWT_SECRET: change-me-in-production BASE_URL: http://localhost:8000 PORT: 8000 NATS_URL: nats://nats:4222 RUST_LOG: info STORAGE_BACKEND: local STORAGE_PATH: /data/media volumes: - media_data:/data/media depends_on: postgres: condition: service_healthy nats: condition: service_started worker: build: . entrypoint: ["./thoughts-worker"] environment: DATABASE_URL: postgres://postgres:postgres@postgres:5432/thoughts BASE_URL: http://localhost:8000 NATS_URL: nats://nats:4222 RUST_LOG: info depends_on: postgres: condition: service_healthy nats: condition: service_started frontend: build: context: ./thoughts-frontend args: NEXT_PUBLIC_API_URL: http://localhost:8000 NEXT_PUBLIC_SERVER_SIDE_API_URL: http://api:8000 ports: - "3000:3000" depends_on: - api volumes: postgres_data: media_data: