🔧 chore(docker-compose.yml): update backend.env file path to remove leading './' for consistency 🔧 chore(docker-compose.yml): remove explicit port mapping for backend service to use the default port 🔧 chore(docker-compose.yml): add deploy configuration for celery worker service to ensure only one replica is deployed 🔧 chore(docker-compose.yml): add prometheus and grafana services with necessary configurations and dependencies 📝 docs(prometheus.yml): add prometheus configuration file with scrape targets for prometheus and flower services
120 lines
2.5 KiB
YAML
120 lines
2.5 KiB
YAML
version: "3.3"
|
|
|
|
services:
|
|
backend:
|
|
build:
|
|
context: ../
|
|
dockerfile: base.Dockerfile
|
|
# user: your-non-root-user # Make sure your Dockerfile creates this user
|
|
depends_on:
|
|
- queue
|
|
- db
|
|
env_file:
|
|
- backend.env
|
|
ports:
|
|
- "7860"
|
|
volumes:
|
|
- ../:/app
|
|
- ./startup-backend.sh:/startup-backend.sh # Ensure the paths match
|
|
command: /startup-backend.sh # Fixed the path
|
|
healthcheck:
|
|
test: "exit 0"
|
|
|
|
db:
|
|
image: postgres:15.4
|
|
env_file:
|
|
- ./db.env
|
|
ports:
|
|
- "5432:5432"
|
|
|
|
pgadmin:
|
|
image: dpage/pgadmin4
|
|
env_file:
|
|
- ./pgadmin.env
|
|
ports:
|
|
- "5050:80"
|
|
depends_on:
|
|
- db
|
|
volumes:
|
|
- ./pgadmin:/var/lib/pgadmin
|
|
|
|
queue:
|
|
image: redis:6.2.5
|
|
ports:
|
|
- "6379:6379"
|
|
healthcheck:
|
|
test: "exit 0"
|
|
|
|
celeryworker:
|
|
# user: your-non-root-user
|
|
depends_on:
|
|
queue:
|
|
condition: service_healthy
|
|
env_file:
|
|
- ./celeryworker.env
|
|
build:
|
|
context: ../
|
|
dockerfile: base.Dockerfile
|
|
command: celery -A langflow.worker.celery_app worker --loglevel=INFO
|
|
healthcheck:
|
|
test: "exit 0"
|
|
deploy:
|
|
replicas: 1
|
|
|
|
flower:
|
|
# user: your-non-root-user
|
|
networks:
|
|
- default
|
|
depends_on:
|
|
queue:
|
|
condition: service_healthy
|
|
celeryworker:
|
|
condition: service_healthy
|
|
build:
|
|
context: ../
|
|
dockerfile: base.Dockerfile
|
|
env_file:
|
|
- ./flower.env
|
|
command: /bin/sh -c "celery -A langflow.worker.celery_app --broker=redis://$${LANGFLOW_REDIS_PASSWORD:+default:$${LANGFLOW_REDIS_PASSWORD}@}$${LANGFLOW_REDIS_HOST}:$${LANGFLOW_REDIS_PORT}/$${LANGFLOW_REDIS_DB} flower --port=5555"
|
|
ports:
|
|
- "5555:5555"
|
|
|
|
frontend:
|
|
# user: your-non-root-user
|
|
build:
|
|
context: ../src/frontend
|
|
dockerfile: Dockerfile
|
|
args:
|
|
- BACKEND_URL=http://backend:7860
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
env_file:
|
|
- ./frontend.env
|
|
ports:
|
|
- "80:80"
|
|
restart: on-failure
|
|
|
|
prometheus:
|
|
image: prom/prometheus:v2.37.9
|
|
volumes:
|
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
|
command:
|
|
- "--config.file=/etc/prometheus/prometheus.yml"
|
|
ports:
|
|
- "9090:9090"
|
|
healthcheck:
|
|
test: "exit 0"
|
|
|
|
grafana:
|
|
image: grafana/grafana:8.2.6
|
|
depends_on:
|
|
prometheus:
|
|
condition: service_healthy
|
|
ports:
|
|
- "3000:3000"
|
|
volumes:
|
|
- grafana_data:/var/lib/grafana
|
|
|
|
volumes:
|
|
grafana_data:
|