-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (29 loc) · 908 Bytes
/
Dockerfile
File metadata and controls
39 lines (29 loc) · 908 Bytes
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
FROM php:7.4-fpm-alpine as base
WORKDIR /var/www/html
RUN apk --update add \
build-base \
autoconf \
libzip-dev \
postgresql-dev \
zip
RUN docker-php-ext-install sockets zip pdo pdo_pgsql
RUN echo "memory_limit=512M" >> /usr/local/etc/php/php.ini
USER www-data
ENV APP_ENV=prod
COPY --from=composer /usr/bin/composer /usr/bin/composer
ENV COMPOSER_MEMORY_LIMIT -1
COPY composer.json .
COPY composer.lock .
# ---- Dependencies ----
FROM base AS dependencies
# install vendors
USER www-data
RUN APP_ENV=prod composer install --prefer-dist --no-plugins --no-scripts --no-dev --optimize-autoloader
RUN mkdir bin
# ---- Release ----
FROM base AS release
USER www-data
COPY --chown=www-data:www-data . .
COPY --chown=www-data:www-data --from=dependencies /var/www/html/bin bin
COPY --chown=www-data:www-data --from=dependencies /var/www/html/vendor /var/www/html/vendor
RUN touch .env