Dockerfile 2.95 KB
Newer Older
Ludwig Ruderstaller's avatar
Ludwig Ruderstaller committed
1
FROM php:7.3.12-fpm-alpine
2 3 4 5
MAINTAINER Ludwig Ruderstaller "l.ruderstaller@cwd.at"

ENV COMPOSER_ALLOW_SUPERUSER=1 \
    COMPOSER_DISABLE_XDEBUG_WARN=1 \
Ludwig Ruderstaller's avatar
Ludwig Ruderstaller committed
6
    PHPREDIS_VERSION=5.1.1 
7 8 9
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php

RUN set -xe \
10
 && apk add --no-cache --virtual .build-deps \            
11
            tzdata \
12
	    $PHPIZE_DEPS \
13
 && apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ --allow-untrusted \
14 15 16 17
 && cp /usr/share/zoneinfo/UTC /etc/localtime \
 && echo 'UTC' > /etc/localtime \

 && apk add --no-cache \
18
	openssl-dev \
19 20 21 22 23 24
        bash \
        freetype-dev \
        libpng-dev \
        libjpeg-turbo-dev \
        sqlite-dev \
        curl \
Ludwig Ruderstaller's avatar
Ludwig Ruderstaller committed
25
	curl-dev \
26 27 28 29 30 31 32 33
        libsodium-dev \
        icu-dev \
        libxml2-dev \
        recode-dev \
        libxslt-dev \
        git \
        postgresql-client \
        postgresql-dev \
34
        openssh-client \
Ludwig Ruderstaller's avatar
Ludwig Ruderstaller committed
35
                libzip-dev \
Ludwig Ruderstaller's avatar
Ludwig Ruderstaller committed
36
         && apk --update --no-cache add grep \
37 38 39 40
 && mkdir -p /usr/src/php/ext/redis \
 && curl -L https://github.com/phpredis/phpredis/archive/$PHPREDIS_VERSION.tar.gz | tar xvz -C /usr/src/php/ext/redis --strip 1 \
 && echo 'redis' >> /usr/src/php-available-exts \

Ludwig Ruderstaller's avatar
Ludwig Ruderstaller committed
41
  && docker-php-ext-configure gd \
42 43 44
      --with-freetype-dir=/usr/include/ \
      --with-png-dir=/usr/include/ \
      --with-jpeg-dir=/usr/include/ \
Ludwig Ruderstaller's avatar
Ludwig Ruderstaller committed
45
 
46 47
 && docker-php-ext-install -j$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1)\
    	gd \
Ludwig Ruderstaller's avatar
testing  
Ludwig Ruderstaller committed
48 49
        bcmath \
        opcache \
50 51 52 53 54 55
        iconv \
        mysqli \
        pdo \
        pdo_mysql \
        pdo_sqlite \
        pdo_pgsql \
Ludwig Ruderstaller's avatar
testing  
Ludwig Ruderstaller committed
56
        zip \
57 58 59 60 61
        xml \
        xsl \
        intl \
        json \
        mbstring \
62 63
                hash \
                curl \
64 65 66 67 68
        simplexml \
        soap \
        bcmath \
        redis \
    
Ludwig Ruderstaller's avatar
Ludwig Ruderstaller committed
69
 && docker-php-ext-install sodium \
70

Ludwig Ruderstaller's avatar
Ludwig Ruderstaller committed
71
 && pecl install mongodb \
Ludwig Ruderstaller's avatar
Ludwig Ruderstaller committed
72
 && docker-php-ext-enable mongodb \
73
 && apk del .build-deps \
Ludwig Ruderstaller's avatar
testing  
Ludwig Ruderstaller committed
74
 && rm -rf /tmp/* /var/cache/apk/* 
75

Ludwig Ruderstaller's avatar
testing  
Ludwig Ruderstaller committed
76
    RUN echo "memory_limit = 128M" > /usr/local/etc/php/conf.d/custom.ini \
77 78 79 80
    && echo "max_execution_time = 60" >> /usr/local/etc/php/conf.d/custom.ini \
    && echo "error_reporting=E_ALL" >> /usr/local/etc/php/conf.d/custom.ini \
    && echo "log_errors=On" >> /usr/local/etc/php/conf.d/custom.ini \
    && echo "error_log = /proc/self/fd/2" >> /usr/local/etc/php/conf.d/custom.ini \
Ludwig Ruderstaller's avatar
Ludwig Ruderstaller committed
81
    && echo "expose_php = Off" >> /usr/local/etc/php/conf.d/custom.ini \
Ludwig Ruderstaller's avatar
fix  
Ludwig Ruderstaller committed
82 83
    && echo "pm.status_path = /status" >> /usr/local/etc/php-fpm.d/zz-docker.conf \
    && echo "ping.path = /ping" >> /usr/local/etc/php-fpm.d/zz-docker.conf \
Ludwig Ruderstaller's avatar
testing  
Ludwig Ruderstaller committed
84
    && echo "catch_workers_output = yes" >> /usr/local/etc/php-fpm.d/zz-docker.conf 
85

Ludwig Ruderstaller's avatar
Ludwig Ruderstaller committed
86 87
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer global require hirak/prestissimo --no-plugins --no-scripts
88 89 90 91 92

RUN addgroup -S sudo \
    && adduser -h /home/web -u 1000 -S -s /bin/bash -G sudo web \
    && echo "%sudo ALL=NOPASSWD:ALL" > /etc/sudoers