-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
43 lines (32 loc) · 1.13 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
ARG PHP_VERSION=8.1
FROM php:${PHP_VERSION}-cli-alpine AS app_php_base
COPY ./docker/cron-entrypoint.sh /usr/local/bin/cron-entrypoint
RUN chmod +x /usr/local/bin/cron-entrypoint
# persistent / runtime deps
RUN apk add --no-cache \
nano \
;
ARG APCU_VERSION=5.1.18
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/bin/
RUN chmod +x /usr/bin/install-php-extensions
RUN install-php-extensions \
apcu \
opcache
COPY --from=composer /usr/bin/composer /usr/bin/composer
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV PATH="${PATH}:/root/.composer/vendor/bin"
WORKDIR /var/app
# "php prod" stage
FROM app_php_base AS app_php
# prevent the reinstallation of vendors at every changes in the source code
COPY composer.* ./
RUN set -eux; \
composer install --prefer-dist --no-dev --no-scripts --no-progress --no-suggest; \
composer clear-cache
COPY bin bin/
COPY src src/
COPY templates templates/
RUN set -eux; \
composer dump-autoload --classmap-authoritative --no-dev; \
chmod +x bin/console; sync