forked from AmpersandTarski/RAP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
147 lines (139 loc) · 4.46 KB
/
Copy pathdocker-compose.yml
File metadata and controls
147 lines (139 loc) · 4.46 KB
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
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:
external: true
db:
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:v1.1.1
build:
context: RAP4USER
rap4:
image: ampersandtarski/ampersand-rap:2021-08-10
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:v1.1.1
- 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
- db
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
- 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"]
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:
- 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:
- db
- proxy