-
Notifications
You must be signed in to change notification settings - Fork 106
/
Dockerfile
44 lines (32 loc) · 1.26 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
FROM php:8.0.19-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 \
bash \
git \
subversion \
openssh-client
RUN curl -sSLf \
-o /usr/local/bin/install-php-extensions \
https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && \
chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions opcache pdo_pgsql intl zip @composer && \
rm /usr/local/bin/install-php-extensions
# 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; composer clear-cache