-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
135 lines (135 loc) · 5.49 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
version: '3'
services:
# OPTIONAL: Setup act for testing GitGub Actions locally
# You can also install on your workstation, for example:
# $ choco install act-cli
# $ act -s GITHUB_TOKEN="$(gh auth token)" --secret-file example.secrets -W './.github/workflows/db.yml'
# act:
# build:
# context: .
# dockerfile: ACT.Dockerfile
# args:
# TEST: 123
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# - ./:/github/workspace
# Build moodle and plugins from repo, then save to shared volume on startup
# After build, the moodle files need to be copied to the shared volume,
# where they can be accessed by the php, cron and web containers.
moodle:
tty: true
restart: "no"
environment:
DB_PASSWORD: ${DB_PASSWORD:-moodle}
DB_USER: ${DB_USER:-moodle}
DB_NAME: ${DB_NAME:-moodle}
build:
context: .
dockerfile: Moodle.Dockerfile
args:
MOODLE_ENVIRONMENT: ${MOODLE_ENVIRONMENT:-local}
DOCKER_FROM_IMAGE: ${IMAGE_REPO}${PHP_IMAGE:-php:8.0-fpm}
MOODLE_BRANCH_VERSION: ${MOODLE_BRANCH_VERSION:-MOODLE_311_STABLE}
F2F_BRANCH_VERSION: ${F2F_BRANCH_VERSION:-MOODLE_400_STABLE}
HVP_BRANCH_VERSION: ${HVP_BRANCH_VERSION:-stable}
FORMAT_BRANCH_VERSION: ${FORMAT_BRANCH_VERSION:-MOODLE_311}
CERTIFICATE_BRANCH_VERSION: ${CERTIFICATE_BRANCH_VERSION:-MOODLE_311_STABLE}
CUSTOMCERT_BRANCH_VERSION: ${CUSTOMCERT_BRANCH_VERSION:-MOODLE_311_STABLE}
DATAFLOWS_BRANCH_VERSION: ${DATAFLOWS_BRANCH_VERSION:-MOODLE_35_STABLE}
volumes:
- ./temp/var/www:/var/www:delegated
# Keep the container running so we can run the migration scripts and copy the files to the shared volume
command: tail -F anything
web:
depends_on:
php:
condition: service_healthy
image: ${WEB_IMAGE:-nginx-unprivileged:1.25.4-alpine-slim}
ports:
- "8080:8080"
volumes:
- ./config/nginx/default.conf:/etc/nginx/conf.d/default.conf:delegated
- ./temp/var/www:/var/www:delegated
links:
- php
db:
image: ${DB_IMAGE:-mariadb:10}
env_file: .env
volumes:
- mysqldata:/var/lib/mysql:delegated
- ./temp/db-backups:/tmp/db-backups:delegated
ports:
- 3307:3306
healthcheck:
test: [
"CMD-SHELL",
"healthcheck.sh --innodb_initialized --connect"
]
interval: 10s
timeout: 5s
retries: 5
php:
depends_on:
db:
condition: service_healthy
tty: true
restart: "no"
env_file:
- .env
environment:
XDEBUG_MODE: debug
XDEBUG_CONFIG: client_host=host.docker.internal client_port=9003
DB_PASSWORD: ${DB_PASSWORD:-moodle}
DB_USER: ${DB_USER:-moodle}
DB_NAME: ${DB_NAME:-moodle}
build:
context: .
dockerfile: PHP.Dockerfile
args:
DOCKER_FROM_IMAGE: ${IMAGE_REPO}${PHP_IMAGE:-php:8.0-fpm}
PHP_INI_ENVIRONMENT: ${PHP_INI_ENVIRONMENT:-production}
MOODLE_BRANCH_VERSION: ${MOODLE_BRANCH_VERSION:-MOODLE_311_STABLE}
F2F_BRANCH_VERSION: ${F2F_BRANCH_VERSION:-MOODLE_400_STABLE}
HVP_BRANCH_VERSION: ${HVP_BRANCH_VERSION:-stable}
FORMAT_BRANCH_VERSION: ${FORMAT_BRANCH_VERSION:-MOODLE_311}
CERTIFICATE_BRANCH_VERSION: ${CERTIFICATE_BRANCH_VERSION:-MOODLE_311_STABLE}
CUSTOMCERT_BRANCH_VERSION: ${CUSTOMCERT_BRANCH_VERSION:-MOODLE_311_STABLE}
DATAFLOWS_BRANCH_VERSION: ${DATAFLOWS_BRANCH_VERSION:-MOODLE_35_STABLE}
volumes:
- ./temp/var/www:/var/www:delegated
# Copy files from build directory to www/html to mimic shared PVC copy in OpenShift (allows for multiple container instances)
# Note: THis will add a few minutes to startup.
# command: bash -c "cp /app/public /var/www/html -r && stdout_logfile=/dev/stdout && stdout_logfile_maxbytes=0 && stderr_logfile=/dev/stderr && stderr_logfile_maxbytes=0 && /usr/local/bin/docker-php-entrypoint"
# or Without copy (to save some time if it doesn't need to be rebuilt)
# command: bash -c "stdout_logfile=/dev/stdout && stdout_logfile_maxbytes=0 && stderr_logfile=/dev/stderr && stderr_logfile_maxbytes=0 && /usr/local/bin/docker-php-entrypoint"
# command: tail -F anything # (to keep the container running)
command: php-fpm
healthcheck:
# test: [
# "CMD-SHELL",
# "php-fpm-healthcheck.sh --listen-queue=10 --accepted-conn=5000 || kill 1"
# ]
test: [
"CMD-SHELL",
"php-fpm-healthcheck"
]
interval: 10s
timeout: 5s
retries: 5
cron:
depends_on:
db:
condition: service_healthy
env_file: .env
build:
context: .
dockerfile: CRON.Dockerfile
args:
DOCKER_FROM_IMAGE: ${IMAGE_REPO}${CRON_IMAGE:-php:8.0-cli}
PHP_INI_ENVIRONMENT: ${PHP_INI_ENVIRONMENT:-production}
volumes:
- ./temp/var/www:/var/www:delegated
redis:
image: ${REDIS_IMAGE:-redis:latest}
volumes:
mysqldata: {}