-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (27 loc) · 1.21 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
FROM php:7.4-fpm-alpine
LABEL maintainer "jinlife <[email protected]>"
# Download customized Caddy
RUN set -eux; \
wget -O /usr/bin/caddy "https://caddyserver.com/api/download?os=linux&arch=amd64&p=github.com%2Fcaddy-dns%2Fcloudflare"; \
chmod +x /usr/bin/caddy; \
caddy version
COPY Caddyfile /etc/Caddyfile
ENV CADDYPATH=/srv/caddycerts
WORKDIR /opt
COPY entrypoint.sh /bin/entrypoint.sh
RUN chmod +x /bin/entrypoint.sh
# Timezone
RUN rm -rf /etc/localtime \
&& ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" /etc/timezone
# Support GD extension https://github.com/ThanisornJ/Docker-Laravel/blob/db92988506636273aa03e5101a47a5b52a6bfe73/docker-php-alpine/Dockerfile
RUN apk add --no-cache \
freetype-dev libpng-dev libjpeg-turbo-dev freetype libpng libjpeg-turbo sqlite-dev libzip-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg && \
NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) \
&& docker-php-ext-install -j${NPROC} gd pdo pdo_mysql pdo_sqlite opcache zip calendar \
&& apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev
WORKDIR /srv/html
EXPOSE 80 443 2015
VOLUME /srv
ENTRYPOINT ["/bin/entrypoint.sh"]