-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-stack.yml
128 lines (120 loc) · 2.95 KB
/
docker-stack.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
version: "3"
networks:
local:
driver: overlay
driver_opts:
encrypted: "true"
services:
# postgres database
db:
env_file:
- "./.envs/.local/.common.internal.env"
image: postgres:12.2-alpine
volumes:
- ./volumes/postgres_data:/var/lib/postgresql/data/
restart: on-failure:5
networks:
- local
redis:
command: ["redis-server", "--appendonly", "yes"]
image: redis:latest
hostname: redis
# env_file:
# - ".env"
restart: on-failure:5
command: redis-server /usr/local/etc/redis/redis.conf
volumes:
- ./.envs/.local/redis.conf:/usr/local/etc/redis/redis.conf
- ./volumes/redis_data:/data
networks:
- local
# memcached
memcached:
image: memcached:latest
# ports:
# - "////:11211"
restart: on-failure:5
networks:
- local
# saas api container
api:
env_file:
- "./.env"
- "./.envs/.local/.common.internal.env"
- './.envs/.local/.api.env'
build:
context: ./saasServer/
dockerfile: Dockerfile
args:
ENV: ${ENV}
PORT: ${API_INTERNAL_PORT}
image: saascontainerization_api
command: ["/scripts/wait-for", "tasks.db:5432", "--", "./run.sh"]
volumes:
- ./saasServer:/usr/src/app:rw
- ./volumes/server_media:/usr/src/app/saasrest/media:rw
- ./volumes/server_static:/usr/src/app/saasrest/collected_static:rw
- ./wait-for:/scripts/wait-for
deploy:
replicas: 1
depends_on:
- db
- redis
- memcached
restart: on-failure:0
networks:
- local
# saas web client
webclient:
image: saascontainerization_webclient
deploy:
replicas: 1
env_file:
- "./.env"
- "./.envs/.local/.webclient.env"
build:
context: ./saasWebClient/
dockerfile: Dockerfile
args:
ENV: ${ENV}
# PORT: 4200 by default
# environment:
# PORT: 4200 by default
volumes:
- ./saasWebClient:/usr/src/app:rw
- ./volumes/webclient_browser_dist:/usr/src/app/dist:rw
depends_on:
- api
restart: on-failure:5
networks:
- local
# nginx wrapper
wrapper:
env_file:
- "./.env"
- "./.envs/.local/.wrapper.env"
image: saascontainerization_wrapper
command: ["/scripts/wait-for", "tasks.api:80", "--", "/scripts/wait-for", "tasks.webclient:4200", "--", "./run.sh"]
volumes:
- ./volumes/server_media:/data/server_media:ro
- ./volumes/server_static/:/data/server_static:ro
- ./volumes/webclient_browser_dist:/data/webclient_dist:ro
- ./wait-for:/scripts/wait-for
deploy:
replicas: 1
build:
context: ./saasWrapper/
dockerfile: Dockerfile
environment:
WEBCLIENT_HOST: webclient
WEBCLIENT_PORT: 4200
API_HOST: api
API_PORT: 80
ports:
- "${WRAPPER_PUBLIC_PORT}:80"
restart: on-failure:5
networks:
- local
depends_on:
- api
- webclient