-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (37 loc) · 1.5 KB
/
Dockerfile
File metadata and controls
46 lines (37 loc) · 1.5 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
# syntax=docker/dockerfile:1.4
FROM node:22.11.0 AS node
FROM php:8.0-apache AS base
# Install system and PHP deps
RUN --mount=type=cache,target=/var/lib/apt/lists,sharing=private \
--mount=type=cache,target=/var/cache/apt,sharing=private \
apt-get update && \
apt-get install -y --no-install-recommends \
git \
libxml2-dev libpng-dev watchman libonig-dev libicu-dev \
curl gnupg2 lsb-release ca-certificates unzip && \
docker-php-ext-configure intl --with-icu-dir=/usr && \
docker-php-ext-install \
intl \
mysqli iconv mbstring tokenizer soap ctype simplexml gd dom xml && \
rm -rf /var/lib/apt/lists/*
# Install Node
COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node /usr/local/bin/node /usr/local/bin/node
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm
# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Clone Moodle and grant permissions
RUN git clone -b MOODLE_402_STABLE --depth 1 \
git://git.moodle.org/moodle.git /var/www/html/moodle \
&& mkdir -p /var/www/moodledata \
&& chmod -R 777 /var/www/html/moodle /var/www/moodledata
# Add custom config to php
RUN {\
echo 'max_input_vars=5000'; \
echo 'php_admin_flag[log_errors] = on'; \
echo 'php_flag[display_errors] = off'; \
}>/usr/local/etc/php/conf.d/custom.ini
EXPOSE 3000
WORKDIR /var/www/html/moodle/
# Node deps (Moodle tooling)
RUN npm ci