-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.production.yml
76 lines (71 loc) · 1.79 KB
/
docker-compose.production.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
65
66
67
68
69
70
71
72
73
74
75
76
version: '3.6'
services:
api:
image: org/app-api:version
command: sh -c 'export DATABASE_URL=`cat $$DATABASE_URL_FILE` && node-pg-migrate up && node src/index.js'
ports:
- "80:3001"
env_file:
- .env
environment:
NODE_ENV: production
DATABASE_URL_FILE: /run/secrets/database_url
JWT_KEY_FILE: /run/secrets/jwt_key
GITHUB_CLIENT_ID_FILE: /run/secrets/github_client_id
GITHUB_CLIENT_SECRET_FILE: /run/secrets/github_client_secret
GOOGLE_CLIENT_ID_FILE: /run/secrets/google_client_id
GOOGLE_CLIENT_SECRET_FILE: /run/secrets/google_client_secret
secrets:
- database_url
- jwt_key
- github_client_id
- github_client_secret
- google_client_id
- google_client_secret
deploy:
replicas: 2
resources:
limits:
cpus: "0.1"
memory: 50M
restart_policy:
condition: on-failure
networks:
- webnet
postgres:
environment:
POSTGRES_USER: ubuntu
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
POSTGRES_DB: app-db
secrets:
- db_password
networks:
- webnet
visualizer:
image: dockersamples/visualizer:stable
ports:
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
placement:
constraints: [node.role == manager]
networks:
- webnet
secrets:
database_url:
file: secret_database_url.txt
db_password:
file: secret_db_password.txt
jwt_key:
file: secret_jwt_key.txt
github_client_id:
file: secret_github_client_id.txt
github_client_secret:
file: secret_github_client_secret.txt
google_client_id:
file: secret_google_client_id.txt
google_client_secret:
file: secret_google_client_secret.txt
networks:
webnet: