This repository has been archived by the owner on Jun 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
62 lines (52 loc) · 1.65 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
FROM composer:latest as composer
FROM alpine:3.7
LABEL maintainer="amelia@lolibrary.org"
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_NO_INTERACTION 1
ENV COMPOSER_HOME /usr/lib/composer
ENV COMPOSER_CACHE_DIR /var/cache/composer
ENV PHP_INI_SCAN_DIR /etc/php7/conf.d
# key from https://php.codecasts.rocks/php-alpine.rsa.pub on 2018-03-30T09:14:00+01:00
COPY codecasts.pub /etc/apk/keys/php-alpine.rsa.pub
# add the www-data user
RUN set -x \
&& addgroup -g 82 -S www-data \
&& adduser -u 82 -D -S -G www-data www-data \
&& apk --update add ca-certificates \
&& update-ca-certificates \
&& echo "@php https://php.codecasts.rocks/v3.7/php-7.2" >> /etc/apk/repositories \
&& apk --update add \
php7@php \
php7-fpm@php \
php7-ctype@php \
php7-curl@php \
php7-dom@php \
php7-gd@php \
php7-iconv@php \
php7-intl@php \
php7-json@php \
php7-mbstring@php \
php7-opcache@php \
php7-openssl@php \
php7-pcntl@php \
php7-phar@php \
php7-posix@php \
php7-session@php \
php7-xml@php \
php7-zip@php \
php7-zlib@php \
php7-pdo_pgsql@php \
&& ln -s /usr/bin/php7 /usr/bin/php \
&& rm -rf /var/cache/apk/* \
&& rm /etc/init.d/php-fpm7 \
&& mkdir -p /srv/code
# copy over composer
COPY --from=composer /usr/bin/composer /usr/bin
# add fpm files
COPY ["php-fpm.conf", "php.ini", "/etc/php7/"]
RUN composer global require hirak/prestissimo \
&& rm -rf /var/cache/composer/* \
&& php-fpm7 -t
WORKDIR /srv/code
EXPOSE 9000
CMD ["/usr/sbin/php-fpm7", "-c", "/etc/php7/php.ini", "--nodaemonize"]