-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
94 lines (89 loc) · 3.05 KB
/
Copy pathdocker-compose.yml
File metadata and controls
94 lines (89 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Local development dependencies for the Leoflow control plane.
#
# Brings up Postgres and Redis matching the server's default configuration:
# database.url = postgres://leoflow:leoflow@localhost:5432/leoflow
# redis.url = redis://localhost:6379/0
#
# Usage:
# make dev-up # start Postgres + Redis (wait healthy) and apply migrations
# make dev-down # stop, keeping data
# make dev-reset # wipe data and restart fresh
#
# This is for local development only; production runs managed Postgres/Redis.
services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_USER: leoflow
POSTGRES_PASSWORD: leoflow
POSTGRES_DB: leoflow
ports:
- "5432:5432"
volumes:
- leoflow-pgdata:/var/lib/postgresql/data
# On a fresh volume, also provision the isolated `leoflow_test` database
# so integration tests never pollute the dev `leoflow` DB. For an existing
# volume this init hook does not re-run — use `make test-db`.
- ./deploy/initdb:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U leoflow -d leoflow"]
interval: 5s
timeout: 3s
retries: 10
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- leoflow-redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
# The two services below form the full single-host demo stack and are gated
# behind the "demo" profile, so `make dev-up` still brings up only Postgres +
# Redis. Run the whole stack (UI included) with:
# docker compose --profile demo up --build
# then open http://localhost:8080 and log in as admin@leoflow.local / admin.
# One-shot migration runner: applies all up migrations, then exits.
migrate:
profiles: ["demo"]
image: migrate/migrate:v4.18.1
depends_on:
postgres:
condition: service_healthy
volumes:
- ./migrations:/migrations:ro
command:
- "-path=/migrations"
- "-database=postgres://leoflow:leoflow@postgres:5432/leoflow?sslmode=disable"
- "up"
# The control plane: serves /api/v2, /ui, and the embedded Airflow 3.2.1 UI.
leoflow-server:
profiles: ["demo"]
build:
context: .
dockerfile: deploy/Dockerfile.server
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
migrate:
condition: service_completed_successfully
environment:
LEOFLOW_DATABASE_URL: postgres://leoflow:leoflow@postgres:5432/leoflow?sslmode=disable
LEOFLOW_REDIS_URL: redis://redis:6379/0
LEOFLOW_AUTH_JWT_SECRET: dev-secret-change-me
# Seeds admin@leoflow.local with this password on first boot (dev only).
LEOFLOW_BOOTSTRAP_PASSWORD: admin
# The distroless image runs as nonroot, which cannot create /var/log;
# write task logs under a world-writable path instead.
LEOFLOW_LOGS_DIR: /tmp/leoflow-logs
ports:
- "8080:8080"
- "9090:9090"
volumes:
leoflow-pgdata:
leoflow-redisdata: