forked from acmephp/acmephp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
74 lines (57 loc) · 1.82 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
FROM alpine:3.7 AS builder
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /srv
# Composer dependencies
RUN apk add --no-cache \
php7 \
php7-phar \
php7-json \
php7-iconv \
php7-mbstring \
php7-curl \
php7-opcache \
php7-sockets \
php7-openssl
RUN composer global require "hirak/prestissimo" "jderusse/composer-warmup"
RUN echo "opcache.enable_cli=1" > /etc/php7/conf.d/opcache.ini \
&& echo "opcache.file_cache='/tmp/opcache'" >> /etc/php7/conf.d/opcache.ini \
&& echo "opcache.file_update_protection=0" >> /etc/php7/conf.d/opcache.ini \
&& mkdir /tmp/opcache
COPY composer.json /srv/
# App dependencies
RUN apk add --no-cache \
php7-simplexml \
php7-dom \
php7-tokenizer
RUN composer install --no-dev --no-scripts --no-suggest --optimize-autoloader \
&& composer require "daverandom/libdns:^2.0" --no-scripts --no-suggest --optimize-autoloader
COPY ./src /srv/src
COPY ./res /srv/res
COPY ./bin /srv/bin
RUN composer warmup-opcode -- /srv
# =============================
FROM alpine:3.7
WORKDIR /srv
# PHP
RUN apk add --no-cache \
php7 \
php7-opcache \
php7-apcu \
php7-openssl \
php7-dom \
php7-mbstring \
php7-json \
php7-ctype \
php7-posix \
php7-simplexml \
php7-xmlwriter \
ca-certificates
RUN echo "date.timezone = UTC" > /etc/php7/conf.d/symfony.ini \
&& echo "opcache.enable_cli=1" > /etc/php7/conf.d/opcache.ini \
&& echo "opcache.file_cache='/tmp/opcache'" >> /etc/php7/conf.d/opcache.ini \
&& echo "opcache.file_update_protection=0" >> /etc/php7/conf.d/opcache.ini \
&& mkdir /tmp/opcache
ENTRYPOINT ["/srv/bin/acme"]
CMD ["list"]
COPY --from=builder /tmp/opcache /tmp/opcache
COPY --from=builder /srv /srv