-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
112 lines (105 loc) · 2.67 KB
/
docker-compose.yml
File metadata and controls
112 lines (105 loc) · 2.67 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
105
106
107
108
109
110
111
112
services:
db:
image: postgis/postgis:14-3.5
environment:
POSTGRES_USER: 'brostar'
POSTGRES_PASSWORD: 'brostar'
POSTGRES_DB: 'brostar'
healthcheck:
test: ["CMD-SHELL", "pg_isready -U brostar"]
interval: 5s
timeout: 5s
retries: 5
volumes:
- pgdata:/var/lib/postgresql/data
redis:
image: redis:latest
command: redis-server --maxmemory 512mb --maxmemory-policy allkeys-lru
restart: unless-stopped
expose:
- 6379
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
celery_default:
environment:
# # Can be set in .env, we'll pass them on. settings.py has some defaults.
- FIELD_ENCRYPTION_KEY
- SECRET_KEY
- NENS_AUTH_ISSUER
- NENS_AUTH_CLIENT_ID
- NENS_AUTH_CLIENT_SECRET
- NENS_AUTH_RESOURCE_SERVER_ID
build: .
volumes:
- .:/code
- ./media:/media # <- this is crucial
command: >
uv run celery -A brostar_api worker
-Q default
--concurrency=4
--max-memory-per-child=100000
--loglevel=INFO
--hostname=default@%h
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
celery_upload:
environment:
# # Can be set in .env, we'll pass them on. settings.py has some defaults.
- FIELD_ENCRYPTION_KEY
- SECRET_KEY
- NENS_AUTH_ISSUER
- NENS_AUTH_CLIENT_ID
- NENS_AUTH_CLIENT_SECRET
- NENS_AUTH_RESOURCE_SERVER_ID
build: .
volumes:
- .:/code
- ./media:/media # <- this is crucial
command: >
uv run celery -A brostar_api worker
-Q upload
--concurrency=4
--max-memory-per-child=250000
--loglevel=INFO
--hostname=upload@%h
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
web:
environment:
# # Can be set in .env, we'll pass them on. settings.py has some defaults.
- FIELD_ENCRYPTION_KEY
- SECRET_KEY
- NENS_AUTH_ISSUER
- NENS_AUTH_CLIENT_ID
- NENS_AUTH_CLIENT_SECRET
- NENS_AUTH_RESOURCE_SERVER_ID
build: .
command: "uv run gunicorn --bind=0.0.0.0:8000 --workers=3 --timeout=180 --preload --max-requests=10000 brostar_api.wsgi"
ports:
- "8000:8000"
volumes:
- .:/code
- ./media:/media
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
celery_default:
condition: service_started
celery_upload:
condition: service_started
volumes:
pgdata:
redis-data: