-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
60 lines (53 loc) · 1.12 KB
/
docker-compose.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
---
version: "3.8"
services:
database:
image: "postgres:11"
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DATABASE: database
PGDATA: /var/lib/postgresql/data/pgdata
deploy:
mode: "replicated"
replicas: 1
placement:
constraints:
- node.labels.database==yes
secrets:
- ig_password
volumes:
- "/mnt/efs:/var/lib/postgresql/data"
- "/create_db.sh:/docker-entrypoint-initdb.d"
image_gallery:
image: "postgres:11"
environment:
IG_PASSWORD: ig_password
IG_USER: image_gallery
POSTGRES_DATABASE: image_gallery
deploy:
mode: "replicated"
replicas: 0
secrets:
- ig_password
volumes:
- "/app/creat_db.sh"
ports:
- target: 5000
published: 8888
mode: host
protocol: tcp
flask:
image: "localhost:5000/flask"
deploy:
placement:
constraints:
- node.labels.flask_server==yes
secrets:
- ig_password
volumes:
database:
external: true
secrets:
ig_password:
external: true