forked from repman-io/repman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (42 loc) · 1.38 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
44
45
46
47
48
49
50
51
52
FROM php:7.4.5-fpm-alpine
ARG TIMEZONE="UTC"
SHELL ["sh", "-eo", "pipefail", "-c"]
# install composer and extensions: pdo_pgsql, intl, zip
RUN apk update && \
apk add --no-cache -q \
$PHPIZE_DEPS \
bash \
git \
subversion \
zip \
unzip \
postgresql-dev \
icu-dev \
libzip-dev \
openssh-client \
&& \
curl -sS https://getcomposer.org/installer | \
php -- --install-dir=/usr/local/bin --filename=composer && \
docker-php-ext-configure pdo_pgsql --with-pdo-pgsql && \
docker-php-ext-configure intl && \
docker-php-ext-configure zip && \
docker-php-ext-install pdo_pgsql && \
docker-php-ext-install intl && \
docker-php-ext-install zip && \
rm -rf /var/cache/apk/*
# set timezone
RUN ln -snf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && \
echo ${TIMEZONE} > /etc/timezone && \
printf '[PHP]\ndate.timezone = "%s"\n', "$TIMEZONE" > \
/usr/local/etc/php/conf.d/tzone.ini && "date"
# set memory limit
RUN echo "memory_limit=512M" > /usr/local/etc/php/conf.d/memory-limit.ini
# hide X-Powered-By in reponse header
RUN echo "expose_php=off" > /usr/local/etc/php/conf.d/expose.ini
# automatically add new host keys to the user known hosts
RUN printf "Host *\n StrictHostKeyChecking no" > /etc/ssh/ssh_config
RUN mkdir /app
WORKDIR /app
COPY . .
ENV APP_ENV=prod
RUN composer install --optimize-autoloader --no-dev