-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
71 lines (66 loc) · 1.59 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
services:
db:
image: mariadb
ports:
- 3306:3306
restart: always
volumes:
- db_data:/var/lib/mysql
- ./db/my.cnf:/etc/mysql/my.cnf
- ./backups/sql:/opt/backups
command:
- "--character-set-server=utf8mb4"
- "--collation-server=utf8mb4_unicode_ci"
- "--innodb-read-only-compressed=OFF"
env_file: .env
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_ALLOW_EMPTY_PASSWORD=0
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- TZ=Europe/Paris
redis:
image: redis
restart: always
ports:
- 6379:6379
volumes:
- redis_data:/data
app:
build: ./app
working_dir: /var/www/html
env_file: .env
depends_on:
- db
- redis
volumes:
- ./app/moodle_data:/var/moodledata
- ./app/config.php:/var/www/html/config.php
- type: bind
source: ${APP_SRC}
target: /var/www/html
ports:
- 9000:9000
nginx:
image: nginx:latest
ports:
- 80:80
volumes:
- ./nginx/dev/moodle.template.conf:/etc/nginx/conf.d/default.template
- ./nginx/log:/var/log/nginx
- type: bind
source: ${APP_SRC}
target: /var/www/html
restart: always
depends_on:
- db
- app
command: /bin/bash -c "envsubst '$$DOMAIN' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
environment:
- DOMAIN=${DOMAIN}
volumes:
db_data:
driver: local
redis_data:
driver: local