-
-
Notifications
You must be signed in to change notification settings - Fork 101
/
Copy pathDockerfile
65 lines (40 loc) · 1.3 KB
/
Dockerfile
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
# PHP
FROM php:7.4-fpm
# System packages
RUN apt-get update
RUN apt-get install -y texlive-full
RUN apt-get install -y python3-pygments
RUN apt-get install -y libnotify-bin
RUN apt-get install -y git
RUN apt-get install -y rsync
# PHP extensions
# https://github.com/mlocati/docker-php-extension-installer
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extensions gd intl pdo_mysql opcache zip
# Composer
COPY --from=composer:2.2.3 /usr/bin/composer /usr/local/bin/composer
# Node.js
# https://github.com/nvm-sh/nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
SHELL ["/bin/bash", "--login", "-c"]
RUN command -v nvm
RUN nvm install 21.4.0
# Node.js global packages
RUN npm install -g gulp-cli --loglevel=verbose
RUN npm install -g pageres-cli --loglevel=verbose --unsafe-perm=true
# PHP configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
RUN sed -i 's,^memory_limit =.*$,memory_limit = -1,' "$PHP_INI_DIR/php.ini"
# Code
COPY . /code
WORKDIR /code
# Environment variables
ENV VENDOR_DIR=/code/vendor
# PHP packages
RUN composer install
# Node.js packages
RUN npm install --loglevel=verbose
# Assets
RUN npm run build
# Framework configuration
RUN ./init --env=Docker --overwrite=n