-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile
79 lines (73 loc) · 2.42 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
75
76
77
78
79
FROM php:8.0-fpm-alpine
ENV ASUSER= \
UID= \
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1 \
PHP_DATE_TIMEZONE=UTC \
PHP_MEMORY_LIMIT=256M \
PHP_MAX_INPUT_VARS=1000 \
PHP_UPLOAD_MAX_FILESIZE=25M \
PHP_POST_MAX_SIZE=25M \
PHP_MAX_EXECUTION_TIME=30 \
PHP_FPM_LISTEN=9000 \
PHP_FPM_MAX_CHILDREN=10 \
PHP_FPM_REQUEST_TERMINATE_TIMEOUT=60 \
ENTRYPOINT=entrypoint.php.sh
WORKDIR /app
RUN adduser -D -u 1337 kool \
&& addgroup kool www-data \
# dockerize
&& curl -L https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-alpine-linux-amd64-v0.6.1.tar.gz | tar xz \
&& mv dockerize /usr/local/bin/dockerize \
# deps
&& apk --no-cache add su-exec bash sed git openssh-client icu shadow procps \
freetype libpng libjpeg-turbo libzip-dev ghostscript imagemagick \
jpegoptim optipng pngquant gifsicle libldap \
libpq less \
# build-deps
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
freetype-dev libpng-dev libjpeg-turbo-dev \
icu-dev libedit-dev libxml2-dev \
imagemagick-dev openldap-dev oniguruma-dev libwebp-dev \
postgresql-dev \
linux-headers \
# php-ext
&& docker-php-ext-configure gd --with-freetype --with-webp --with-jpeg \
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
&& docker-php-ext-install -j$(nproc) \
bcmath \
calendar \
exif \
gd \
intl \
ldap \
mbstring \
opcache \
pcntl \
pdo \
pdo_mysql \
pdo_pgsql \
soap \
xml \
zip \
sockets \
mysqli \
ftp \
&& pecl install redis \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& docker-php-ext-enable redis \
&& cp "/usr/local/etc/php/php.ini-production" "/usr/local/etc/php/php.ini" \
# composer
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& curl -sS https://getcomposer.org/installer | php -- --1 --install-dir=/usr/local/bin --filename=composer1 \
# cleanup
&& apk del .build-deps \
&& rm -rf /var/cache/apk/* /tmp/*
COPY kool.ini /kool/kool.tmpl
COPY zz-docker.conf /kool/zz-docker.tmpl
COPY entrypoint /kool/entrypoint
RUN chmod +x /kool/entrypoint
EXPOSE 9000
ENTRYPOINT [ "/kool/entrypoint" ]
CMD [ "php-fpm" ]