-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.staging.yml
64 lines (56 loc) · 1.62 KB
/
docker-compose.staging.yml
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
# Identical to production.yml, but with the following differences:
# Uses the django production settings file, but staging .env file.
# Uses "local" database
#
# 1. The database is a service in the Docker Compose configuration rather than external as in production.
# 2. Redis is a service in the Docker Compose configuration rather than external as in production.
# 3. Port 5001 is exposed for the Django application.
version: "3"
volumes:
ami_local_postgres_data: {}
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
depends_on:
- postgres
- redis
env_file:
- ./.envs/.production/.django
- ./.envs/.local/.postgres
volumes:
- ./config:/app/config
ports:
- "5001:5000"
command: /start
postgres:
build:
context: .
# There is not a local/staging version of the Postgres Dockerfile.
dockerfile: ./compose/local/postgres/Dockerfile
# Share the local Postgres image with the staging configuration.
# Production uses an external Postgres service.
volumes:
- ami_local_postgres_data:/var/lib/postgresql/data
- ./data/db/snapshots:/backups
env_file:
- ./.envs/.local/.postgres
redis:
image: redis:6
celeryworker:
<<: *django
scale: 1
ports: []
command: /start-celeryworker
celerybeat:
<<: *django
ports: []
command: /start-celerybeat
flower:
<<: *django
ports:
- "5550:5555"
command: /start-flower