name: healine services: db: image: postgres:18 container_name: postgres__healine environment: POSTGRES_DB: healine POSTGRES_USER: healine POSTGRES_PASSWORD: healine ports: - "${DB_PORT:-5432}:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U healine -d healine"] interval: 5s timeout: 5s retries: 5 volumes: - postgres_data:/var/lib/postgresql - ./backend/scripts/init/create-svix-db.sql:/docker-entrypoint-initdb.d/create-svix-db.sql:ro app: build: context: ./backend dockerfile: Dockerfile container_name: backend__healine image: healine-platform:latest pull_policy: never command: scripts/start/app.sh env_file: - ./backend/config/.env environment: - DB_HOST=db - REDIS_HOST=redis ports: - "${API_PORT:-8000}:8000" depends_on: db: condition: service_healthy redis: condition: service_started develop: watch: - action: sync path: ./backend/app target: /root_project/app - action: sync+restart path: ./backend/migrations target: /root_project/migrations - action: sync+restart path: ./backend/config/.env target: /root_project/config/.env - action: sync path: ./backend/scripts target: /root_project/scripts - action: sync path: ./backend/tests target: /root_project/tests - action: rebuild path: ./backend/uv.lock restart: on-failure celery-worker: container_name: celery-worker__healine image: healine-platform:latest pull_policy: never command: scripts/start/worker.sh env_file: - ./backend/config/.env environment: - DB_HOST=db - REDIS_HOST=redis depends_on: - redis - db - app develop: watch: - action: sync+restart path: ./backend/app target: /root_project/app - action: sync path: ./backend/scripts target: /root_project/scripts celery-beat: container_name: celery-beat__healine image: healine-platform:latest pull_policy: never command: scripts/start/beat.sh env_file: - ./backend/config/.env environment: - DB_HOST=db - REDIS_HOST=redis depends_on: - redis - db - app develop: watch: - action: sync+restart path: ./backend/app target: /root_project/app - action: sync path: ./backend/scripts target: /root_project/scripts flower: container_name: flower__healine image: healine-platform:latest pull_policy: never command: scripts/start/flower.sh env_file: - ./backend/config/.env environment: - DB_HOST=db - REDIS_HOST=redis ports: - "${FLOWER_PORT:-5555}:5555" depends_on: - redis - db - app develop: watch: - action: sync path: ./backend target: /root_project ignore: - .venv/ redis: container_name: redis__healine image: redis:8 entrypoint: - sh - -c - | # Seed AOF from an existing RDB before enabling it, otherwise Redis boots # empty and ignores dump.rdb. Skipped once appendonlydir exists. if [ ! -d /data/appendonlydir ] && [ -f /data/dump.rdb ]; then redis-server --daemonize no & RPID=$$! until redis-cli ping >/dev/null 2>&1; do sleep 0.2; done redis-cli CONFIG SET appendonly yes sleep 1 until redis-cli INFO persistence | grep -q 'aof_rewrite_in_progress:0'; do sleep 0.2; done redis-cli SHUTDOWN NOSAVE wait "$$RPID" 2>/dev/null fi exec redis-server --appendonly yes --appendfsync everysec ports: - "${REDIS_PORT:-6379}:6379" volumes: - redis_data:/data svix-server: container_name: svix-server__healine image: svix/svix-server:v1 entrypoint: - sh - -c - | : "$${SVIX_JWT_SECRET:=$$SECRET_KEY}" export SVIX_JWT_SECRET exec svix-server "$$@" - -- command: ["--run-migrations"] env_file: - ./backend/config/.env environment: SVIX_DB_DSN: "postgresql://${DB_USER:-healine}:${DB_PASSWORD:-healine}@${DB_HOST:-db}:${DB_PORT:-5432}/svix" SVIX_QUEUE_TYPE: "redis" SVIX_REDIS_DSN: "redis://redis:6379/1" SVIX_CACHE_TYPE: "redis" ports: - "${SVIX_PORT:-8071}:8071" depends_on: db: condition: service_healthy redis: condition: service_started healthcheck: test: ["CMD", "svix-server", "healthcheck", "http://localhost:8071"] interval: 5s timeout: 3s retries: 20 start_period: 10s restart: on-failure frontend: build: context: ./frontend dockerfile: Dockerfile.dev container_name: frontend__healine image: healine-frontend:dev pull_policy: never env_file: # .env.example supplies the defaults; .env overrides it when present. - ./frontend/.env.example - path: ./frontend/.env required: false ports: - "${FRONTEND_PORT:-3000}:3000" depends_on: - app develop: watch: - action: sync path: ./frontend/src target: /app/src - action: sync path: ./frontend/public target: /app/public - action: rebuild path: ./frontend/package.json - action: rebuild path: ./frontend/pnpm-lock.yaml - action: rebuild path: ./frontend/vite.config.ts restart: on-failure volumes: postgres_data: redis_data: