services: postgres: image: postgres:16-alpine container_name: ai_postgres restart: unless-stopped environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres - POSTGRES_DB=ai_influencer ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-ai_influencer}"] interval: 5s timeout: 5s retries: 20 redis: image: redis:7-alpine container_name: ai_redis restart: unless-stopped ports: - "${REDIS_PORT:-6379}:6379" volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 20 server: build: context: ./app/server dockerfile: Dockerfile container_name: ai_server restart: unless-stopped depends_on: postgres: condition: service_healthy redis: condition: service_healthy env_file: - ./app/server/.env environment: DB_HOST: postgres DB_PORT: 5432 REDIS_HOST: redis REDIS_PORT: 6379 ports: - "3000:3000" worker: build: context: ./app/server dockerfile: Dockerfile container_name: ai_worker restart: unless-stopped command: ["node", "dist/worker"] depends_on: postgres: condition: service_healthy redis: condition: service_healthy server: condition: service_started env_file: - ./app/server/.env environment: DB_HOST: postgres DB_PORT: 5432 REDIS_HOST: redis REDIS_PORT: 6379 client: build: context: ./app/client dockerfile: Dockerfile env_file: - ./app/client/.env container_name: ai_client restart: unless-stopped depends_on: server: condition: service_started ports: - "5173:80" volumes: postgres_data: redis_data: