-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yaml
82 lines (72 loc) · 1.5 KB
/
docker-compose.prod.yaml
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
version: "3.9"
services:
redis:
image: redis
networks:
- backend_network
restart: always
postgres:
image: postgres
networks:
- backend_network
volumes:
- postgres_volume:/var/lib/postgresql/data/
environment:
POSTGRES_USER: my_vocab_db_user
POSTGRES_PASSWORD: my_vocab_db_password
POSTGRES_DB: my_vocab
restart: always
migration:
build:
context: .
target: main
networks:
- backend_network
env_file:
- .env.prod
environment:
APP_ENV: prod
DB_URL: postgresql://my_vocab_db_user:my_vocab_db_password@postgres:5432/my_vocab
REDIS_URL: redis://redis:6379/
depends_on:
- postgres
command: pipenv run alembic upgrade head
restart: on-failure
gunicorn:
build:
context: .
target: main
networks:
backend_network:
aliases:
- gunicorn_host
expose:
- 8000
env_file:
- .env.prod
environment:
APP_ENV: prod
APP_HOST: 0.0.0.0
APP_PORT: 8000
DB_URL: postgresql://my_vocab_db_user:my_vocab_db_password@postgres:5432/my_vocab
REDIS_URL: redis://redis:6379/
FORWARDED_ALLOW_IPS: "*"
depends_on:
- migration
- redis
restart: always
nginx:
build:
context: ./nginx
networks:
- backend_network
ports:
- "80:80"
- "443:443"
depends_on:
- gunicorn
restart: always
networks:
backend_network:
volumes:
postgres_volume: