feat: compose stack in devcontainer (db, langflow, lfx)
- docker-compose.yml with app/db/langflow/lfx services and healthchecks - Dockerfile.lfx (stateless flow runtime on :6004) - init-db.sql (langflow + test databases) - devcontainer.json switched to compose mode with runServices - setup.sh waits for compose services and requires .env
This commit is contained in:
parent
86fe4424e7
commit
2ba062c4c5
6 changed files with 154 additions and 9 deletions
91
.devcontainer/docker-compose.yml
Normal file
91
.devcontainer/docker-compose.yml
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
# Compose stack for the kirche-einfach devcontainer.
|
||||
# VS Code attaches to the `app` service (see devcontainer.json); all values
|
||||
# come from the repo-root `.env` via `env_file` (no ${} interpolation needed).
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
FORGEJO_USERNAME: jonas
|
||||
command: sleep infinity
|
||||
volumes:
|
||||
- ..:/workspaces/kirche-einfach:cached
|
||||
- kirche-einfach-venv:/workspaces/kirche-einfach/backend/.venv
|
||||
- kirche-einfach-node-modules:/workspaces/kirche-einfach/frontend/node_modules
|
||||
env_file:
|
||||
- ../.env
|
||||
ports:
|
||||
- "8000:8000" # FastAPI
|
||||
- "3000:3000" # Vite
|
||||
|
||||
db:
|
||||
image: postgres:16-trixie
|
||||
env_file:
|
||||
- ../.env
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
- ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql:ro
|
||||
ports:
|
||||
- "5432:5432"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
|
||||
langflow:
|
||||
image: langflowai/langflow:1.12.0
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
env_file:
|
||||
- ../.env
|
||||
environment:
|
||||
# Static values only; secrets/URLs come from ../.env via env_file
|
||||
# (compose interpolates ${} from .devcontainer/.env, not the repo-root .env).
|
||||
LANGFLOW_CONFIG_DIR: /app/langflow
|
||||
LANGFLOW_HOST: 0.0.0.0
|
||||
PORT: "7860"
|
||||
LANGFLOW_AUTO_LOGIN: "false"
|
||||
LANGFLOW_API_KEY_SOURCE: env
|
||||
volumes:
|
||||
- langflow-data:/app/langflow
|
||||
ports:
|
||||
- "7860:7860"
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"python -c \"import urllib.request; urllib.request.urlopen('http://localhost:7860/health', timeout=5)\"",
|
||||
]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
start_period: 60s
|
||||
|
||||
lfx:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.lfx
|
||||
volumes:
|
||||
- lfx-data:/flows
|
||||
ports:
|
||||
- "6004:6004"
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"python -c \"import urllib.request; urllib.request.urlopen('http://localhost:6004/health', timeout=5)\"",
|
||||
]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 12
|
||||
start_period: 30s
|
||||
|
||||
volumes:
|
||||
kirche-einfach-venv:
|
||||
kirche-einfach-node-modules:
|
||||
postgres-data:
|
||||
langflow-data:
|
||||
lfx-data:
|
||||
Loading…
Add table
Add a link
Reference in a new issue