-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
85 lines (80 loc) · 2.57 KB
/
Copy pathdocker-compose.yml
File metadata and controls
85 lines (80 loc) · 2.57 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
services:
# The default app, built from ./Dockerfile. Self-contained: SQLite on a
# named volume, no Postgres and no Redis required, so
# `docker compose up --build app` works with nothing else running. The image
# ships no Celery module — worker/beat below are the background-jobs half and
# still expect the shared ../dev-services stack.
app:
build:
context: .
dockerfile: Dockerfile
environment:
# Left unset the entrypoint generates an ephemeral key (fine for a demo,
# logs a warning, invalidates sessions on restart).
- SM_SECRET_KEY
# First-boot admin seed, applied only while the users table is empty.
# Unset, the entrypoint seeds admin@example.com with a generated
# password and prints it — see `docker compose logs app`.
- SM_USERS_BOOTSTRAP_EMAIL
- SM_USERS_BOOTSTRAP_PASSWORD
ports:
# SM_APP_PORT frees you from a host-port clash with `make dev`.
- "${SM_APP_PORT:-8000}:8000"
volumes:
- appdata:/app/data
# Postgres + Redis now come from the shared ../dev-services stack
# (one PostGIS + one Redis on the external `devnet` network). Start it first
# with `make up` in ~/Repos/dev-services. This project uses:
# database: simple_module_python (on shared postgres:5432, postgres/postgres)
# redis: DB 4 (broker) / DB 5 (result backend)
worker:
build:
context: .
dockerfile: docker/worker.Dockerfile
env_file:
- path: .env
required: false
environment:
SM_BG_TASKS_BROKER_URL: redis://redis:6379/4
SM_BG_TASKS_RESULT_BACKEND: redis://redis:6379/5
SM_DATABASE_URL: ${SM_DATABASE_URL:-postgresql+asyncpg://postgres:postgres@postgres:5432/simple_module_python}
networks: [devnet]
command:
- "uv"
- "run"
- "celery"
- "-A"
- "scripts.run_worker:celery"
- "worker"
- "-l"
- "info"
- "--concurrency=4"
beat:
build:
context: .
dockerfile: docker/worker.Dockerfile
env_file:
- path: .env
required: false
environment:
SM_BG_TASKS_BROKER_URL: redis://redis:6379/4
SM_BG_TASKS_RESULT_BACKEND: redis://redis:6379/5
SM_DATABASE_URL: ${SM_DATABASE_URL:-postgresql+asyncpg://postgres:postgres@postgres:5432/simple_module_python}
depends_on:
worker:
condition: service_started
networks: [devnet]
command:
- "uv"
- "run"
- "celery"
- "-A"
- "scripts.run_worker:celery"
- "beat"
- "-l"
- "info"
networks:
devnet:
external: true
volumes:
appdata: