-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathdocker-compose.production.yml
More file actions
63 lines (58 loc) · 1.8 KB
/
docker-compose.production.yml
File metadata and controls
63 lines (58 loc) · 1.8 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
# This is a transitional production configuration.
# Traffic or NGINX may or may not be used in the final production configuration
# but the Django container will not expose its port to the host (there will be more than one container).
services:
django: &django
build:
context: .
# This is the most important setting to test the production configuration of Django.
dockerfile: ./compose/production/django/Dockerfile
image: insectai/ami_backend
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.postgres
volumes:
- ./config:/app/config
ports:
- "5001:5000"
extra_hosts: # hostname aliases to the IPs of persistant services running outside docker network
- "db:${DATABASE_IP}"
- "rabbitmq:${RABBITMQ_IP}"
- "redis:${REDIS_IP}"
- "nats:${NATS_IP}"
command: /start
scale: 1 # Can't scale until the load balancer is within the compose config
restart: always
# Only the antenna (default) queue runs here, alongside beat. The jobs and
# ml_results queues are served by dedicated worker hosts (see
# docker-compose.worker.yml) so heavy, bursty ML work doesn't compete with
# Django/beat for CPU and memory on this box.
celeryworker:
<<: *django
scale: 1
ports: []
command: /start-celeryworker
environment:
CELERY_QUEUES: "antenna"
restart: always
celerybeat:
<<: *django
ports: []
command: /start-celerybeat
restart: always
flower:
<<: *django
ports:
- "5550:5555"
command: /start-flower
restart: always
volumes:
- ./data/flower/:/data/
awscli:
build:
context: .
dockerfile: ./compose/production/aws/Dockerfile
env_file:
- ./.envs/.production/.django
volumes:
- ./backups/production/postgres:/backups:z