-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.legacy
32 lines (26 loc) · 935 Bytes
/
Dockerfile.legacy
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
FROM composer:2.2 AS composer
FROM php:5.6-fpm
ARG UID
#ENV PHP_MEMORY_LIMIT=1024M
ENV DEBIAN_FRONTEND=noninteractive
# For PHP 5.6 image, update sources.list to outdated Debian archives
RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list && \
sed -i s/security.debian.org/archive.debian.org/g /etc/apt/sources.list && \
sed -i s/stretch-updates/stretch/g /etc/apt/sources.list
# Install dependencies
RUN apt update && \
apt install -y --no-install-recommends \
git \
zip \
unzip \
rsync \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
# Create non-root user
RUN useradd -u ${UID} -ms /bin/bash phpuser
WORKDIR /home/phpuser
USER phpuser
COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY --chown=phpuser ./src/composer.json ./src/composer.json
RUN composer install --prefer-dist --no-progress --working-dir=./src