-
Notifications
You must be signed in to change notification settings - Fork 35
/
Dockerfile
32 lines (24 loc) · 905 Bytes
/
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
ARG PHP_VERSION=7.4
FROM php:${PHP_VERSION:-7.4}
ARG DEBIAN_FRONTEND=noninteractive
ARG COMPOSER_FLAGS="--prefer-dist --no-interaction"
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_PROCESS_TIMEOUT 3600
WORKDIR /code/
COPY composer-install.sh /tmp/composer-install.sh
RUN apt-get update -q \
&& apt-get install unzip git wget -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& /tmp/composer-install.sh \
&& rm /tmp/composer-install.sh \
&& mv composer.phar /usr/local/bin/composer
## Composer - deps always cached unless changed
# First copy only composer files
COPY composer.* /code/
# Download dependencies, but don't run scripts or init autoloaders as the app is missing
RUN composer install $COMPOSER_FLAGS --no-scripts --no-autoloader
# copy rest of the app
COPY . /code/
# run normal composer - all deps are cached already
RUN composer install $COMPOSER_FLAGS
CMD bash