-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
30 lines (21 loc) · 945 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
ARG PHP_VERSION=8.1
# the default env bellow is used when build pipeline sends "PHP_VERSION=" - the above default value is ignored in that case
FROM php:${PHP_VERSION:-8.1} as dev
ARG COMPOSER_FLAGS="--prefer-dist --no-interaction --classmap-authoritative --no-scripts"
MAINTAINER Martin Halamicek <[email protected]>
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get install unzip git -y \
&& rm -r /var/lib/apt/lists/*
RUN echo "memory_limit = -1" >> /usr/local/etc/php/php.ini
RUN cd \
&& curl -sS https://getcomposer.org/installer | php \
&& ln -s /root/composer.phar /usr/local/bin/composer
WORKDIR /code
# Composer - deps always cached unless changed
# First copy only composer files
COPY composer.* ./
# 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 . .
RUN composer install $COMPOSER_FLAGS