-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
152 lines (139 loc) · 5.47 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
version: "3"
services:
webserver:
image: "moodlehq/moodle-php-apache:${MOODLE_DOCKER_PHP_VERSION}"
container_name: ${PROJECT_NAME}_webserver
depends_on:
- ${MOODLE_DOCKER_DB}
volumes:
- "./web:/var/www"
- "${ASSETDIR}/web/apache2/apache2_faildumps.conf:/etc/apache2/conf-enabled/apache2_faildumps.conf"
- "${ASSETDIR}/web/apache2/apache2_mailhog.conf:/etc/apache2/conf-enabled/apache2_mailhog.conf"
- "${ASSETDIR}/web/apache2/apache2_conf.conf:/etc/apache2/conf-enabled/apache2_conf.conf"
- "${ASSETDIR}/web/php-ini/apache2_php.ini:/usr/local/etc/apache2/custom.d/apache2_php.ini"
# - "${ASSETDIR}/web/apache2:/usr/local/etc/apache2/custom.d"
# - "${ASSETDIR}/web/vhost.conf:/etc/apache2/sites-available/000-default.conf"
environment:
MOODLE_DOCKER_DBTYPE: ${MOODLE_DOCKER_DB}
MOODLE_DOCKER_DBHOST: ${DB_HOST}
MOODLE_DOCKER_DBNAME: ${DB_NAME}
MOODLE_DOCKER_DBUSER: ${DB_USER}
MOODLE_DOCKER_DBPASS: ${DB_PASSWORD}
MOODLE_DOCKER_BROWSER: firefox
#MOODLE_DOCKER_BROWSER: chrome
MOODLE_DOCKER_DBCOLLATION: utf8mb4_unicode_ci
MOODLE_DOCKER_WEB_HOST: ${PROJECT_BASE_URL}
MOODLE_DOCKER_WEB_PORT: 8008
APACHE_DOCUMENT_ROOT: ${APACHE_DOCUMENT_ROOT}
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
PHP_INI_SCAN_DIR: "/usr/local/etc/php/custom.d:/usr/local/etc/php/conf.d"
PHP_XDEBUG: 1
PHP_XDEBUG_DEFAULT_ENABLE: 1
PHP_XDEBUG_MODE: coverage
PHP_IDE_CONFIG: serverName=my-ide
PHP_XDEBUG_REMOTE_HOST: 172.17.0.1
PHP_XDEBUG_CLIENT_HOST: host.docker.internal
PHP_EXTENSION_xdebug: 1
labels:
- "traefik.http.routers.${PROJECT_NAME}_webserver.rule=Host(`${PROJECT_BASE_URL}`)"
# The admin instance is responsible for triggering the cron task periodically.
# In this compose setup we use a periodic curl command to the web container
# to keep this simple. In a real deployment environment there may be better
# tools for triggering scheduled tasks.
# moodle-cron:
# image: jsonfry/curl-cron
# container_name: ${PROJECT_NAME}_cron
# environment:
# - MAHARA_URL_SECRET
# - CRON_SCHEDULE=* * * * *
# - OPTIONS=http://${PROJECT_BASE_URL}/admin/cron.php?password=secretcron
# labels:
# - "traefik.http.routers.${PROJECT_NAME}_cron.rule=Host(`cron.${PROJECT_BASE_URL}`)"
mariadb:
image: mariadb:$MARIADB_TAG
container_name: "${PROJECT_NAME}_mariadb"
stop_grace_period: 30s
command: >
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
--innodb_file_per_table=On
--innodb_buffer_pool_size=4096M
--innodb_log_file_size=2048M
--innodb_buffer_pool_instances=4
--thread_pool_size=8
environment:
MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
MYSQL_DATABASE: $DB_NAME
MYSQL_USER: $DB_USER
MYSQL_PASSWORD: $DB_PASSWORD
MYSQL_CLIENT_DEFAULT_CHARACTER_SET: utf8mb4
MYSQL_COLLATION_SERVER: utf8mb4_unicode_ci
MYSQL_INIT_CONNECT: SET NAMES utf8mb4
MYSQL_CHARACTER_SET_SERVER: utf8mb4
MYSQL_CHARACTER_SET_FILESYSTEM: binary
# MYSQL_INNODB_BUFFER_POOL_SIZE: 1024M
volumes:
- ./mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.
- ./mariadb/:/var/lib/mysql # Use bind mount
labels:
- "traefik.http.services.${PROJECT_NAME}_mariadb.loadbalancer.server.port=3306"
- "traefik.http.routers.${PROJECT_NAME}_mariadb.rule=Host(`mariadb.${PROJECT_BASE_URL}`)"
mailhog:
image: mailhog/mailhog
container_name: "${PROJECT_NAME}_mailhog"
labels:
- "traefik.http.services.${PROJECT_NAME}_mailhog.loadbalancer.server.port=8025"
- "traefik.http.routers.${PROJECT_NAME}_mailhog.rule=Host(`mailhog.${PROJECT_BASE_URL}`)"
selenium:
image: "selenium/standalone-firefox${MOODLE_DOCKER_SELENIUM_SUFFIX}:${MOODLE_DOCKER_BROWSER_TAG}"
#image: "selenium/standalone-firefox:latest"
#image: "selenium/standalone-chrome:latest"
container_name: "${PROJECT_NAME}_selenium"
volumes:
- "./web/html:/var/www/html"
ports:
- 5900:5900
- 4444:4444
# redis:
# container_name: "${PROJECT_NAME}_redis"
# image: wodby/redis:$REDIS_TAG
pma:
image: phpmyadmin/phpmyadmin
container_name: "${PROJECT_NAME}_pma"
environment:
PMA_HOST: $DB_HOST
PMA_USER: $DB_USER
PMA_PASSWORD: $DB_PASSWORD
UPLOAD_LIMIT: 1G
labels:
- "traefik.http.routers.${PROJECT_NAME}_pma.rule=Host(`pma.${PROJECT_BASE_URL}`)"
# solr:
# image: wodby/solr:$SOLR_TAG
# container_name: "${PROJECT_NAME}_solr"
# environment:
# SOLR_DEFAULT_CONFIG_SET: $SOLR_CONFIG_SET
# SOLR_HEAP: 1024m
# labels:
# - "traefik.http.services.${PROJECT_NAME}_solr.loadbalancer.server.port=8983"
# - "traefik.http.routers.${PROJECT_NAME}_solr.rule=Host(`solr.${PROJECT_BASE_URL}`)"
# xhprof:
# image: wodby/xhprof:$XHPROF_TAG
# container_name: "${PROJECT_NAME}_xhprof"
# restart: always
# volumes:
# - files:/mnt/files
# labels:
# - "traefik.http.routers.${PROJECT_NAME}_xhprof.rule=Host(`xhprof.${PROJECT_BASE_URL}`)"
traefik:
image: traefik:v2.0
container_name: "${PROJECT_NAME}_traefik"
command: --api.insecure=true --providers.docker
ports:
- '8008:80'
- '8080:8080' # Dashboard
- '33061:3306' # Database
volumes:
- /var/run/docker.sock:/var/run/docker.sock
#volumes:
## For Xdebug profiler
# files: