1- FROM php:7.2.10-fpm-alpine
1+ ARG PHP_BASEIMAGE_VERION=7.3.6
2+ FROM php:${PHP_BASEIMAGE_VERION}-fpm-alpine
23
34LABEL maintainer="Constantine Karnaukhov <genteelknight@gmail.com>"
45
5- # resolves gitlab.com/ric_harvey/nginx-php-fpm#166
6- ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
7- RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community gnu-libiconv
6+ # Setup some env
7+ ENV \
8+ # Setup same composer home directory for all users
9+ COMPOSER_HOME="/usr/local/composer" \
10+ # Fix for iconv: https://github.com/docker-library/php/issues/240
11+ LD_PRELOAD="/usr/lib/preloadable_libiconv.so php"
812
9- # Install nginx
10- RUN NGINX_VERSION=1.14.0 \
11- && LUA_MODULE_VERSION=0.10.13 \
12- && DEVEL_KIT_MODULE_VERSION=0.3.0 \
13- && GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
14- && CONFIG="\
15- --prefix=/etc/nginx \
16- --sbin-path=/usr/sbin/nginx \
17- --modules-path=/usr/lib/nginx/modules \
18- --conf-path=/etc/nginx/nginx.conf \
19- --error-log-path=/var/log/nginx/error.log \
20- --http-log-path=/var/log/nginx/access.log \
21- --pid-path=/var/run/nginx.pid \
22- --lock-path=/var/run/nginx.lock \
23- --http-client-body-temp-path=/var/cache/nginx/client_temp \
24- --http-proxy-temp-path=/var/cache/nginx/proxy_temp \
25- --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
26- --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
27- --http-scgi-temp-path=/var/cache/nginx/scgi_temp \
28- --user=nginx \
29- --group=nginx \
30- --with-http_ssl_module \
31- --with-http_realip_module \
32- --with-http_addition_module \
33- --with-http_sub_module \
34- --with-http_dav_module \
35- --with-http_flv_module \
36- --with-http_mp4_module \
37- --with-http_gunzip_module \
38- --with-http_gzip_static_module \
39- --with-http_random_index_module \
40- --with-http_secure_link_module \
41- --with-http_stub_status_module \
42- --with-http_auth_request_module \
43- --with-http_xslt_module=dynamic \
44- --with-http_image_filter_module=dynamic \
45- --with-http_geoip_module=dynamic \
46- --with-http_perl_module=dynamic \
47- --with-threads \
48- --with-stream \
49- --with-stream_ssl_module \
50- --with-stream_ssl_preread_module \
51- --with-stream_realip_module \
52- --with-stream_geoip_module=dynamic \
53- --with-http_slice_module \
54- --with-mail \
55- --with-mail_ssl_module \
56- --with-compat \
57- --with-file-aio \
58- --with-http_v2_module \
59- --add-module=/usr/src/ngx_devel_kit-$DEVEL_KIT_MODULE_VERSION \
60- --add-module=/usr/src/lua-nginx-module-$LUA_MODULE_VERSION \
61- " \
62- && export LUAJIT_LIB=/usr/lib \
63- && export LUAJIT_INC=/usr/include/luajit-2.1 \
64- && addgroup -S nginx \
65- && adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \
66- && apk add --no-cache --virtual .build-deps \
67- autoconf \
68- gcc \
69- libc-dev \
70- make \
71- libressl-dev \
72- pcre-dev \
73- zlib-dev \
74- linux-headers \
75- curl \
76- gnupg \
77- libxslt-dev \
78- gd-dev \
79- geoip-dev \
80- perl-dev \
81- luajit-dev \
82- && curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \
83- && curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \
84- && curl -fSL https://github.com/simpl/ngx_devel_kit/archive/v$DEVEL_KIT_MODULE_VERSION.tar.gz -o ndk.tar.gz \
85- && curl -fSL https://github.com/openresty/lua-nginx-module/archive/v$LUA_MODULE_VERSION.tar.gz -o lua.tar.gz \
86- && export GNUPGHOME="$(mktemp -d)" \
87- && found='' ; \
88- for server in \
89- ha.pool.sks-keyservers.net \
90- hkp://keyserver.ubuntu.com:80 \
91- hkp://p80.pool.sks-keyservers.net:80 \
92- pgp.mit.edu \
93- ; do \
94- echo "Fetching GPG key $GPG_KEYS from $server" ; \
95- gpg --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$GPG_KEYS" && found=yes && break; \
96- done; \
97- test -z "$found" && echo >&2 "error: failed to fetch GPG key $GPG_KEYS" && exit 1; \
98- gpg --batch --verify nginx.tar.gz.asc nginx.tar.gz \
99- # && rm -r "$GNUPGHOME" nginx.tar.gz.asc \
100- && mkdir -p /usr/src \
101- && tar -zxC /usr/src -f nginx.tar.gz \
102- && tar -zxC /usr/src -f ndk.tar.gz \
103- && tar -zxC /usr/src -f lua.tar.gz \
104- && rm nginx.tar.gz nginx.tar.gz.asc ndk.tar.gz lua.tar.gz \
105- && cd /usr/src/nginx-$NGINX_VERSION \
106- && ./configure $CONFIG --with-debug \
107- && make -j$(getconf _NPROCESSORS_ONLN) \
108- && mv objs/nginx objs/nginx-debug \
109- && mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so \
110- && mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so \
111- && mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so \
112- && mv objs/ngx_http_perl_module.so objs/ngx_http_perl_module-debug.so \
113- && mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so \
114- && ./configure $CONFIG \
115- && make -j$(getconf _NPROCESSORS_ONLN) \
116- && make install \
117- && rm -rf /etc/nginx/html/ \
118- && mkdir /etc/nginx/conf.d/ \
119- && mkdir -p /usr/share/nginx/html/ \
120- && install -m644 html/index.html /usr/share/nginx/html/ \
121- && install -m644 html/50x.html /usr/share/nginx/html/ \
122- && install -m755 objs/nginx-debug /usr/sbin/nginx-debug \
123- && install -m755 objs/ngx_http_xslt_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_xslt_filter_module-debug.so \
124- && install -m755 objs/ngx_http_image_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_image_filter_module-debug.so \
125- && install -m755 objs/ngx_http_geoip_module-debug.so /usr/lib/nginx/modules/ngx_http_geoip_module-debug.so \
126- && install -m755 objs/ngx_http_perl_module-debug.so /usr/lib/nginx/modules/ngx_http_perl_module-debug.so \
127- && install -m755 objs/ngx_stream_geoip_module-debug.so /usr/lib/nginx/modules/ngx_stream_geoip_module-debug.so \
128- && ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \
129- && strip /usr/sbin/nginx* \
130- && strip /usr/lib/nginx/modules/*.so \
131- && rm -rf /usr/src/nginx-$NGINX_VERSION \
132- \
133- # Bring in gettext so we can get `envsubst`, then throw
134- # the rest away. To do this, we need to install `gettext`
135- # then move `envsubst` out of the way so `gettext` can
136- # be deleted completely, then move `envsubst` back.
137- && apk add --no-cache --virtual .gettext gettext \
138- && mv /usr/bin/envsubst /tmp/ \
139- \
140- && runDeps="$( \
141- scanelf --needed --nobanner /usr/sbin/nginx /usr/lib/nginx/modules/*.so /tmp/envsubst \
142- | awk '{ gsub(/,/, " \n so:", $2); print " so:" $2 }' \
143- | sort -u \
144- | xargs -r apk info --installed \
145- | sort -u \
146- )" \
147- && apk add --no-cache --virtual .nginx-rundeps $runDeps \
148- && apk del .build-deps \
149- && apk del .gettext \
150- && mv /tmp/envsubst /usr/local/bin/ \
151- \
152- # forward request and error logs to docker log collector
153- && ln -sf /dev/stdout /var/log/nginx/access.log \
154- && ln -sf /dev/stderr /var/log/nginx/error.log
155-
156- # Configure php-fpm
157- RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
158- echo /etc/apk/respositories && \
159- apk update && apk upgrade &&\
13+ # Install dependencies
14+ RUN echo @testing http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
16015 apk add --no-cache \
16+ nginx \
17+ supervisor \
18+ gomplate \
19+ ssmtp \
20+ mysql-client \
21+ apk-cron \
16122 bash \
23+ su-exec \
24+ git \
16225 openssh-client \
16326 wget \
164- supervisor \
16527 curl \
16628 libcurl \
167- git \
168- python \
169- python-dev \
170- py-pip \
17129 augeas-dev \
17230 libressl-dev \
17331 ca-certificates \
@@ -186,27 +44,26 @@ RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repo
18644 freetype-dev \
18745 sqlite-dev \
18846 libjpeg-turbo-dev \
189- ssmtp \
190- mysql-client \
191- apk-cron && \
47+ acl \
48+ libzip-dev \
49+ && \
19250 docker-php-ext-configure gd \
19351 --with-gd \
19452 --with-freetype-dir=/usr/include/ \
19553 --with-png-dir=/usr/include/ \
19654 --with-jpeg-dir=/usr/include/ && \
19755 docker-php-ext-install iconv pdo_mysql pdo_sqlite mysqli gd exif intl xsl json soap dom zip opcache && \
198- pecl install xdebug-2.6.1 && \
56+ pecl install xdebug-2.7.2 && \
19957 docker-php-source delete && \
58+ mkdir -p $COMPOSER_HOME && \
20059 EXPECTED_COMPOSER_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig) && \
20160 php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
20261 php -r "if (hash_file('SHA384', 'composer-setup.php') === '${EXPECTED_COMPOSER_SIGNATURE}') { echo 'Composer.phar Installer verified'; } else { echo 'Composer.phar Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
20362 php composer-setup.php --install-dir=/usr/bin --filename=composer && \
20463 php -r "unlink('composer-setup.php');" && \
205- composer global require hirak/prestissimo && \
206- pip install -U pip && \
207- pip install -U certbot && \
208- mkdir -p /etc/letsencrypt/webrootauth && \
209- apk del gcc musl-dev linux-headers libffi-dev augeas-dev python-dev make autoconf
64+ apk del gcc musl-dev linux-headers libffi-dev augeas-dev make autoconf && \
65+ apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community gnu-libiconv && \
66+ composer global require hirak/prestissimo
21067
21168# tweak php-fpm config
21269RUN echo "" > /usr/local/etc/php/conf.d/05-php.ini && \
@@ -233,7 +90,7 @@ RUN echo "" > /usr/local/etc/php/conf.d/05-php.ini && \
23390 -e "s/^;clear_env = no$/clear_env = no/" \
23491 /usr/local/etc/php-fpm.d/www.conf
23592
236- EXPOSE 80 443
93+ EXPOSE 8080 8443
23794
23895COPY ./conf/supervisord.conf /etc/
23996
@@ -251,6 +108,6 @@ RUN mkdir -p /etc/nginx && \
251108
252109# Add spaceonfire
253110COPY ./spaceonfire/ /opt/spaceonfire/
254- RUN chmod +x /opt/spaceonfire/init.sh && /opt/spaceonfire/init .sh
111+ RUN chmod -R +x /opt/spaceonfire/bin/* && /opt/spaceonfire/bin/install .sh
255112
256- CMD ["sof-start " ]
113+ CMD ["/opt/spaceonfire/bin/entrypoint.sh " ]
0 commit comments