-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
56 lines (52 loc) · 1.05 KB
/
docker-compose.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
version: '3.7'
services:
api:
build:
context: .
dockerfile: Dockerfile
image: 127.0.0.1:8000/azordev-backend:staging
ports:
- 8000:8000
depends_on:
- postgres
environment:
- DB_HOST=postgres
- DB_USERNAME=prod
- DB_PASSWORD_FILE=/run/secrets/db_password
- DB_NAME=prod
- JWT_SECRET_FILE=/run/secrets/jwt_secret
secrets:
- db_password
- jwt_secret
deploy:
replicas: 1
restart_policy:
condition: on-failure
postgres:
image: postgres:11.3-alpine
ports:
- 5432:5432
volumes:
- pg_data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=prod
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
- POSTGRES_DB=prod
secrets:
- db_password
deploy:
placement:
constraints: [node.role == manager]
networks:
default:
ipam:
config:
- subnet: 172.10.2.0/23
volumes:
pg_data:
driver: local
secrets:
jwt_secret:
external: true
db_password:
external: true