name: nexadash services: postgres: image: postgres:16-alpine container_name: nexadash-postgres restart: unless-stopped environment: POSTGRES_USER: ${POSTGRES_USER:-nexadash} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-change-this-strong-password} POSTGRES_DB: ${POSTGRES_DB:-nexadash} volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-nexadash} -d ${POSTGRES_DB:-nexadash}"] interval: 10s timeout: 5s retries: 5 networks: - nexadash redis: image: redis:7-alpine container_name: nexadash-redis restart: unless-stopped command: redis-server --requirepass ${REDIS_PASSWORD:-change-this-redis-password} volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-change-this-redis-password}", "ping"] interval: 10s timeout: 5s retries: 5 networks: - nexadash api: build: context: . dockerfile: docker/api.Dockerfile container_name: nexadash-api restart: unless-stopped depends_on: postgres: condition: service_healthy redis: condition: service_healthy env_file: - .env environment: DATABASE_URL: ${DATABASE_URL} REDIS_URL: ${REDIS_URL} CELERY_BROKER_URL: ${CELERY_BROKER_URL} CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND} volumes: - plugin_data:/app/plugins ports: - "${API_PORT:-8000}:8000" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/health"] interval: 30s timeout: 10s retries: 3 networks: - nexadash worker: build: context: . dockerfile: docker/worker.Dockerfile container_name: nexadash-worker restart: unless-stopped depends_on: postgres: condition: service_healthy redis: condition: service_healthy env_file: - .env environment: DATABASE_URL: ${DATABASE_URL} REDIS_URL: ${REDIS_URL} CELERY_BROKER_URL: ${CELERY_BROKER_URL} CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND} volumes: - plugin_data:/app/plugins networks: - nexadash web: build: context: . dockerfile: docker/web.Dockerfile container_name: nexadash-web restart: unless-stopped depends_on: api: condition: service_healthy env_file: - .env environment: NEXT_PUBLIC_API_URL: ${NEXADASH_API_URL:-http://localhost:8000} ports: - "${WEB_PORT:-3000}:3000" healthcheck: test: ["CMD", "node", "healthcheck.js"] interval: 30s timeout: 10s retries: 3 networks: - nexadash volumes: postgres_data: redis_data: plugin_data: networks: nexadash: driver: bridge