-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
179 lines (169 loc) · 5.57 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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
version: '3.7'
# to visualize this docker-compose.yml file, if you are on linux, run:
# docker run --rm -it --name dcv -v $(pwd):/input pmsipilot/docker-compose-viz render -f -m image docker-compose.yml -o documentation/docker-compose.png
# run it literally (change NOTHING!) and expect the result in documentation/docker-compose.png
volumes:
rap4-data:
db-data:
letsencrypt:
networks:
proxy:
# network name is used by RAP4 script to make student prototype container accessible via traefik ingress
external: true # must be external to prevent prefix with folder name
rap_db:
# network name is used by RAP4 script to let student prototype container connect to database
external: true # must be external to prevent prefix with folder name
testchannel:
# network testchannel is used by the test-elf to run API-tests on rap4
services:
# reverse proxy
traefik:
image: "traefik:v2.2"
container_name: "traefik"
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "./Traefik/traefik.toml:/etc/traefik/traefik.toml"
- "./Traefik/conf.d:/etc/traefik/conf.d"
- "letsencrypt:/letsencrypt"
networks:
- proxy
dummy-student-prototype:
image: ampersandtarski/rap4-student-prototype:dev-latest
build:
context: RAP4USER
rap4:
image: ampersandtarski/ampersand-rap:dev-latest
container_name: rap4
build:
context: RAP4
restart: always
depends_on:
- db
- traefik
- dummy-student-prototype
environment:
- AMPERSAND_LOG_CONFIG=logging.yaml
- AMPERSAND_DEBUG_MODE=true
- AMPERSAND_PRODUCTION_MODE=${DISABLE_DB_INSTALL} # to disable a database reset in production mode.
- AMPERSAND_DBHOST=db # refers to database service below
- AMPERSAND_DBUSER=ampersand
- AMPERSAND_DBPASS=${MYSQL_AMPERSAND_PASSWORD} # from .env file
- AMPERSAND_DBNAME=rap4
- AMPERSAND_SERVER_URL=https://${SERVER_HOST_NAME} # from .env file
- RAP_HOST_NAME=${SERVER_HOST_NAME}
- RAP_STUDENT_PROTO_IMAGE=ampersandtarski/rap4-student-prototype:dev-latest
- RAP_STUDENT_PROTO_LOG_CONFIG=logging.yaml
- APACHE_RUN_DIR=/var/www
volumes:
- rap4-data:/var/www/data
- "/var/run/docker.sock:/var/run/docker.sock"
networks:
- proxy
- rap_db
- testchannel
labels:
traefik.enable: "true"
traefik.http.routers.rap4-insecure.rule: Host(`${SERVER_HOST_NAME}`)
traefik.docker.network: proxy
# more labels added for production, see ./docker-compose.prod.yml file
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "100"
# demo application Enrollment
enroll:
image: ampersandtarski/enroll:latest
container_name: enroll
build:
context: Demos/Enroll
restart: always
depends_on:
- db
- traefik
networks:
- proxy
- rap_db
environment:
- AMPERSAND_LOG_CONFIG=logging.yaml
- AMPERSAND_DEBUG_MODE=true
- AMPERSAND_PRODUCTION_MODE=${DISABLE_DB_INSTALL} # to disable a database reset in production mode.
- AMPERSAND_DBHOST=db # refers to database service below
- AMPERSAND_DBUSER=ampersand
- AMPERSAND_DBPASS=${MYSQL_AMPERSAND_PASSWORD} # from .env file
- AMPERSAND_DBNAME=enroll
- AMPERSAND_SERVER_URL=https://${SERVER_HOST_NAME} # from .env file
labels:
traefik.enable: "true"
traefik.http.routers.enroll-insecure.rule: Host(`enroll.${SERVER_HOST_NAME}`)
traefik.docker.network: proxy
# more labels added for production, see ./docker-compose.prod.yml file
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "100"
db:
container_name: rap4-db
image: mariadb:10.4
restart: always
command:
[
"--lower-case-table-names=1",
"--sql-mode=ANSI,TRADITIONAL"
] # Whatever is specified here gets appended to the entrypoint defined in the Dockerfile
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} # from .env file, which must be in the build environment
- MYSQL_USER=ampersand # the database user is fixed. No need to make this variable.
- MYSQL_PASSWORD=${MYSQL_AMPERSAND_PASSWORD} # from .env file
volumes:
- db-data:/var/lib/mysql
- ./db-init-scripts:/docker-entrypoint-initdb.d # script to setup db authorization for user ampersand.
networks:
- rap_db
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "100"
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
environment:
PMA_HOST: db # refers to database service above
container_name: phpmyadmin
restart: unless-stopped
labels:
traefik.enable: "true"
traefik.domain: ${SERVER_HOST_NAME}
traefik.http.routers.phpmyadmin-insecure.rule: Host(`phpmyadmin.${SERVER_HOST_NAME}`)
traefik.docker.network: proxy
depends_on:
- db
- traefik
networks:
- rap_db
- proxy
test-elf:
image: ampersandtarski/gatling:3.7.2
container_name: gatling
build:
context: gatling-3-7-2
# restart: unless-stopped # run only once, so never restart
command: "-s RAPtest"
volumes:
- ./gatling-3-7-2/conf:/opt/gatling/conf
- ./gatling-3-7-2/results:/opt/gatling/results
- ./gatling-3-7-2/user-files:/opt/gatling/user-files
depends_on:
- rap4
networks:
- testchannel
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "100"