-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
104 lines (100 loc) · 3.24 KB
/
Copy pathdocker-compose.yml
File metadata and controls
104 lines (100 loc) · 3.24 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
95
96
97
98
99
100
101
102
103
104
services:
postgres:
image: postgres:18
container_name: actaria-postgres
restart: unless-stopped
environment:
POSTGRES_USER: actaria
POSTGRES_PASSWORD: actaria
POSTGRES_DB: actaria
volumes:
- ${ACTARIA_DATA_DIR:-./data}/postgres:/var/lib/postgresql
healthcheck:
test: ["CMD", "pg_isready", "-U", "actaria"]
interval: 5s
timeout: 3s
retries: 10
ports:
- "6432:5432"
redis:
image: redis:7-alpine
container_name: actaria-redis
restart: unless-stopped
command: redis-server --appendonly yes
volumes:
- ${ACTARIA_DATA_DIR:-./data}/redis:/data
ports:
- "6379:6379"
minio:
image: minio/minio:latest
container_name: actaria-minio
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
volumes:
- ${ACTARIA_DATA_DIR:-./data}/minio:/data
ports:
- "9000:9000"
- "9001:9001"
web:
build:
context: .
dockerfile: docker/web/Dockerfile
container_name: actaria-web
restart: unless-stopped
# Dev command — hot-reload server. Prod (1F) uses the Dockerfile default (gunicorn).
command: python manage.py runserver 0.0.0.0:8760
env_file: .env
# In-network service hostnames override whatever is in .env (which is host-local).
environment:
DATABASE_URL: postgres://actaria:actaria@postgres:5432/actaria
REDIS_URL: redis://redis:6379/0
S3_ENDPOINT: http://minio:9000
ALLOWED_HOSTS: "${ALLOWED_HOSTS:-localhost,127.0.0.1},web,0.0.0.0"
volumes:
# Source mount for hot-reload. The named volume on /opt/venv prevents
# the host .venv (built for host Python) from bleeding into the container.
- .:/app
- /opt/venv
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
minio:
condition: service_started
ports:
- "8760:8760"
worker:
build:
context: .
dockerfile: docker/web/Dockerfile
container_name: actaria-worker
restart: unless-stopped
# Phase 1A has no jobs to run yet; this service is a placeholder.
# Plan 1B's compile worker will override the command to `python manage.py rqworker compile`.
command: python manage.py rqworker default email crossref compile
env_file: .env
environment:
DATABASE_URL: postgres://actaria:actaria@postgres:5432/actaria
REDIS_URL: redis://redis:6379/0
S3_ENDPOINT: http://minio:9000
# Same-path mount for docker-out-of-docker compiles: the worker creates
# scratch dirs here, then spawns a sibling texlive container that
# bind-mounts the same host path.
ACTARIA_COMPILE_SCRATCH_DIR: /tmp/actaria-compile
volumes:
- .:/app
- /opt/venv
- /var/run/docker.sock:/var/run/docker.sock
# Bind-mount the host path at the identical container path so that the
# sibling texlive container (spawned via the host docker daemon) sees the
# same directory the worker wrote to.
- /tmp/actaria-compile:/tmp/actaria-compile
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started