@@ -2,24 +2,37 @@ services:
22 # ----------------------------------------------------------------------------------------------------
33 # Web Services
44 # ----------------------------------------------------------------------------------------------------
5- caddy :
6- image : caddy:2.11.1
5+ nginx :
6+ image : nginx:latest
77 env_file : .env
88 environment :
9- - ACME_AGREE=true
9+ - NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx
10+ command : ["nginx", "-g", "daemon off;"]
1011 volumes :
11- - ./Caddyfile:/etc/caddy/Caddyfile
1212 - ./src/staticfiles:/var/www/django/static
13- - ./caddy_data:/data
14- - ./caddy_config:/config
15- - ./var/log/caddy:/var/log/
1613 - ./maintenance_mode/:/srv
14+ - ./certsNginx:/var/cache/nginx/acme-letsencrypt
15+ - ./nginx/:/etc/nginx/templates/
16+ - ./var/log/nginx/:/var/log/nginx
1717 restart : unless-stopped
1818 ports :
1919 - 80:80
2020 - 443:443
21+ - 8000:8000
22+ - 5432:5432
23+ - ${RABBITMQ_MANAGEMENT_PORT:-15672}:15672
24+ - ${RABBITMQ_PORT}:5672
25+ - ${MINIO_PORT}:9000
26+ - ${FLOWER_PUBLIC_PORT:-5555}:5555
2127 depends_on :
2228 - django
29+ - minio
30+ - rabbit
31+ - site_worker
32+ - db
33+ networks :
34+ - frontend
35+ - backend
2336
2437 django :
2538 container_name : django
@@ -39,7 +52,7 @@ services:
3952 - ./var/logs:/app/logs
4053 restart : unless-stopped
4154 ports :
42- - 8000:8000
55+ - 8000
4356 depends_on :
4457 - db
4558 - rabbit
@@ -50,6 +63,8 @@ services:
5063 options :
5164 max-size : " 20m"
5265 max-file : " 5"
66+ networks :
67+ - backend
5368
5469
5570 # ----------------------------------------------------------------------------------------------------
@@ -62,12 +77,14 @@ services:
6277 - ./var/minio:/export
6378 restart : unless-stopped
6479 ports :
65- - $MINIO_PORT: 9000
80+ - 9000
6681 env_file : .env
6782 healthcheck :
6883 test : ["CMD", "curl", "-I", "http://minio:9000/minio/health/live"]
6984 interval : 5s
7085 retries : 5
86+ networks :
87+ - backend
7188 createbuckets :
7289 image : minio/mc:RELEASE.2025-07-21T05-28-08Z
7390 depends_on :
@@ -92,6 +109,8 @@ services:
92109 fi;
93110 exit 0;
94111 "
112+ networks :
113+ - backend
95114
96115 # ----------------------------------------------------------------------------------------------------
97116 # Local development helper, rebuilds RiotJS/Stylus on change
@@ -109,7 +128,6 @@ services:
109128 max-size : " 20m"
110129 max-file : " 5"
111130
112-
113131 # ----------------------------------------------------------------------------------------------------
114132 # Database Service
115133 #
@@ -125,7 +143,7 @@ services:
125143 - POSTGRES_PASSWORD=${DB_PASSWORD}
126144 command : ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr", "-c", "config_file=/etc/postgresql/postgresql.conf"]
127145 ports :
128- - 5432:5432
146+ - 5432
129147 volumes :
130148 - ./var/postgres:/var/lib/postgresql/18/:delegated
131149 - ./backups:/app/backups
@@ -135,6 +153,8 @@ services:
135153 options :
136154 max-size : " 20m"
137155 max-file : " 5"
156+ networks :
157+ - backend
138158
139159 # ----------------------------------------------------------------------------------------------------
140160 # Rabbitmq & Flower monitoring tool
@@ -150,20 +170,18 @@ services:
150170 # containers being destroyed..!
151171 hostname : rabbit
152172 env_file : .env
153- environment :
154- - http_proxy=${RABBITMQ_HTTP_PROXY}
155- - https_proxy=${RABBITMQ_HTTPS_PROXY}
156- - no_proxy=${RABBITMQ_NO_PROXY}
157173 ports :
158- - ${RABBITMQ_MANAGEMENT_PORT:-15672}: 15672
159- - ${RABBITMQ_PORT}: 5672
174+ - 15672
175+ - 5672
160176 volumes :
161177 - ./var/rabbit:/var/lib/rabbitmq
162178 restart : unless-stopped
163179 logging :
164180 options :
165181 max-size : " 20m"
166182 max-file : " 5"
183+ networks :
184+ - backend
167185
168186 flower :
169187 container_name : flower
@@ -173,13 +191,15 @@ services:
173191 - CELERY_BROKER_URL=pyamqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@${RABBITMQ_HOST}:${RABBITMQ_PORT}//
174192 restart : unless-stopped
175193 ports :
176- - ${FLOWER_PUBLIC_PORT:-5555}: 5555
194+ - 5555
177195 depends_on :
178196 - rabbit
179197 logging :
180198 options :
181199 max-size : " 20m"
182200 max-file : " 5"
201+ networks :
202+ - backend
183203
184204 # ----------------------------------------------------------------------------------------------------
185205 # Redis
@@ -188,12 +208,14 @@ services:
188208 container_name : redis
189209 image : redis
190210 ports :
191- - 6379:6379
211+ - 6379
192212 restart : unless-stopped
193213 logging :
194214 options :
195215 max-size : " 20m"
196216 max-file : " 5"
217+ networks :
218+ - backend
197219
198220 # ----------------------------------------------------------------------------------------------------
199221 # Celery Service
@@ -221,6 +243,8 @@ services:
221243 # Limit memory substantially here so we see any problems that may
222244 # appear on Heroku ahead of time
223245 memory : 256M
246+ networks :
247+ - backend
224248
225249 compute_worker :
226250 command : ["celery -A compute_worker worker -l info -Q compute-worker -n compute-worker@%n"]
@@ -249,3 +273,10 @@ services:
249273 options :
250274 max-size : " 20m"
251275 max-file : " 5"
276+ networks :
277+ - backend
278+
279+ networks :
280+ frontend :
281+ backend :
282+ internal : true
0 commit comments