kirche-einfach/docker-compose.yml
Jonas Miederer af993bd43f
Some checks failed
/ test (push) Has been cancelled
/ build (push) Has been cancelled
/ validate (push) Has been cancelled
feat: unify on single repo-root compose file for dev and prod
2026-09-07 19:46:17 +00:00

130 lines
3.5 KiB
YAML

# The single compose file for dev and prod.
#
# Dev: VS Code attaches to `api` (see .devcontainer/devcontainer.json) and
# starts `runServices` (everything but watchtower). Dev specifics
# (autoreload, editor, SSH keys, docker CLI) come from devcontainer.json.
# Prod: `docker compose up -d --build` (own .env with secrets +
# FRONTEND_MODE=preview). Code updates via `git pull` + restart; image
# rebuilds only for dependency changes.
services:
api:
build:
context: ./backend
dockerfile: Dockerfile
env_file:
- .env
volumes:
- .:/srv/kirche-einfach
- kirche-venv:/srv/kirche-einfach/backend/.venv
ports:
- "8000:8000" # FastAPI
depends_on:
lfx:
condition: service_healthy
langflow:
condition: service_healthy
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
"python -c \"import urllib.request; urllib.request.urlopen('http://localhost:8000/health', timeout=5)\"",
]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
env_file:
- .env
environment:
# Dev default (HMR); prod .env sets `preview` (build + serve bundle).
FRONTEND_MODE: ${FRONTEND_MODE:-dev}
volumes:
- .:/srv/kirche-einfach
- kirche-node-modules:/srv/kirche-einfach/frontend/node_modules
ports:
- "3000:3000" # Vite
depends_on:
api:
condition: service_healthy
restart: unless-stopped
langflow:
image: langflowai/langflow:latest
env_file:
- .env
environment:
# Static values only; secrets/URLs come from .env via env_file.
LANGFLOW_CONFIG_DIR: /app/langflow
LANGFLOW_HOST: 0.0.0.0
PORT: "7860"
LANGFLOW_AUTO_LOGIN: "false"
LANGFLOW_API_KEY_SOURCE: env
# SQLite file inside the langflow-data volume (absolute path required
# by Langflow); overrides any postgres URL that may linger in .env.
LANGFLOW_DATABASE_URL: sqlite:////app/langflow/langflow.db
volumes:
- langflow-data:/app/langflow
ports:
- "7860:7860"
labels:
com.centurylinklabs.watchtower.enable: "true"
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
"python -c \"import urllib.request; urllib.request.urlopen('http://localhost:7860/health', timeout=5)\"",
]
interval: 30s
timeout: 5s
retries: 20
start_period: 60s
lfx:
build:
context: .
dockerfile: Dockerfile.lfx
env_file:
- .env
volumes:
- lfx-data:/flows
ports:
- "6004:6004"
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
"python -c \"import urllib.request; urllib.request.urlopen('http://localhost:6004/health', timeout=5)\"",
]
interval: 30s
timeout: 5s
retries: 12
start_period: 30s
# Nightly auto-updates of :latest images (prod). Never started in dev
# (not in devcontainer.json runServices; also needs a docker socket).
watchtower:
image: nickfedor/watchtower:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
WATCHTOWER_LABEL_ENABLE: "true"
WATCHTOWER_SCHEDULE: "0 0 4 * * *"
WATCHTOWER_CLEANUP: "true"
WATCHTOWER_ROLLING_RESTART: "true"
labels:
com.centurylinklabs.watchtower.enable: "true"
restart: unless-stopped
volumes:
kirche-venv:
kirche-node-modules:
langflow-data:
lfx-data: