✨ feat(base.Dockerfile): add healthcheck for queue and celeryworker services to ensure their availability ✨ feat(docker-compose.yml): add healthcheck for queue, celeryworker, and flower services to ensure their availability 🐛 fix(docker-compose.yml): fix the path in the command for backend service startup 🐛 fix(flower.env): add missing double quote at the end of C_FORCE_ROOT value 🐛 fix(startup-backend.sh): remove unnecessary --reload flag from uvicorn command and add --workers -1 flag to utilize all available CPU cores
95 lines
2 KiB
YAML
95 lines
2 KiB
YAML
version: "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: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"
|
|
|
|
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
|