-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
84 lines (80 loc) · 2.34 KB
/
docker-compose.yml
File metadata and controls
84 lines (80 loc) · 2.34 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
volumes:
crawls:
name: "auto-archiver-api"
services:
web:
init: true
build:
context: .
dockerfile: docker/web/Dockerfile
restart: always
env_file: .env.prod
environment:
ENVIRONMENT_FILE: .env.prod
REDIS_HOSTNAME: redis
ports:
- "127.0.0.1:8004:8000"
command: uvicorn app.web:app --factory --host 0.0.0.0
volumes:
- ./logs:/aa-api/logs
- ./database:/aa-api/database
- ./secrets:/aa-api/secrets
depends_on:
- redis
healthcheck:
test: ["CMD", "python3", "-c", 'import sys, urllib.request; sys.exit(urllib.request.urlopen("http://localhost:8000/health").getcode() != 200)']
interval: 30s
timeout: 10s
retries: 3
worker:
init: true
build:
context: .
dockerfile: docker/worker/Dockerfile
restart: always
env_file: .env.prod
command: celery --app=app.worker.main.celery worker -Q high_priority,low_priority --concurrency=${CONCURRENCY} --max-tasks-per-child=50 -O fair --without-heartbeat --without-mingle
deploy:
resources:
limits:
memory: ${WORKER_MEMORY_LIMIT:-4g}
volumes:
- ./logs:/aa-api/logs
- ./database:/aa-api/database
- ./secrets:/aa-api/secrets
- /var/run/docker.sock:/var/run/docker.sock
- crawls:/crawls # BROWSERTRIX_HOME_HOST:BROWSERTRIX_HOME_CONTAINER, do not change /crawls
environment:
REDIS_HOSTNAME: redis
ENVIRONMENT_FILE: .env.prod
WACZ_ENABLE_DOCKER: 1 # Enable calling docker from this container
BROWSERTRIX_HOME_HOST: auto-archiver-api_crawls
BROWSERTRIX_HOME_CONTAINER: /crawls
depends_on:
- web
- redis
healthcheck:
test: ["CMD-SHELL", "./poetry-venv/bin/poetry run celery -A app.worker.main.celery inspect ping || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
redis:
init: true
image: redis:6-alpine
restart: always
env_file: .env.prod
command: redis-server /conf/redis.conf --requirepass ${REDIS_PASSWORD}
deploy:
resources:
limits:
memory: ${REDIS_MEMORY_LIMIT:-1g}
volumes:
- ./redis/data:/data
- ./redis/config:/conf
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s