1- FROM php:8.1.12 -fpm-alpine3.16
1+ FROM php:8.2.3 -fpm-alpine3.17
22
33LABEL maintainer=
"Ric Harvey <[email protected] >" 44
55ENV php_conf /usr/local/etc/php-fpm.conf
66ENV fpm_conf /usr/local/etc/php-fpm.d/www.conf
77ENV php_vars /usr/local/etc/php/conf.d/docker-vars.ini
88
9- ENV NGINX_VERSION 1.22.1
10- ENV LUA_MODULE_VERSION 0.10.22
11- ENV DEVEL_KIT_MODULE_VERSION 0.3.1
129ENV LUAJIT_LIB=/usr/lib
1310ENV LUAJIT_INC=/usr/include/luajit-2.1
1411
1512# resolves #166
1613ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
1714RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community gnu-libiconv
1815
19- RUN GPG_KEYS=573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \
20- && CONFIG="\
21- --prefix=/etc/nginx \
22- --sbin-path=/usr/sbin/nginx \
23- --modules-path=/usr/lib/nginx/modules \
24- --conf-path=/etc/nginx/nginx.conf \
25- --error-log-path=/var/log/nginx/error.log \
26- --http-log-path=/var/log/nginx/access.log \
27- --pid-path=/var/run/nginx.pid \
28- --lock-path=/var/run/nginx.lock \
29- --http-client-body-temp-path=/var/cache/nginx/client_temp \
30- --http-proxy-temp-path=/var/cache/nginx/proxy_temp \
31- --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
32- --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
33- --http-scgi-temp-path=/var/cache/nginx/scgi_temp \
34- --user=nginx \
35- --group=nginx \
36- --with-http_ssl_module \
37- --with-http_realip_module \
38- --with-http_addition_module \
39- --with-http_sub_module \
40- --with-http_dav_module \
41- --with-http_flv_module \
42- --with-http_mp4_module \
43- --with-http_gunzip_module \
44- --with-http_gzip_static_module \
45- --with-http_random_index_module \
46- --with-http_secure_link_module \
47- --with-http_stub_status_module \
48- --with-http_auth_request_module \
49- --with-http_xslt_module=dynamic \
50- --with-http_image_filter_module=dynamic \
51- # --with-http_geoip_module=dynamic \
52- --with-http_perl_module=dynamic \
53- --with-threads \
54- --with-stream \
55- --with-stream_ssl_module \
56- --with-stream_ssl_preread_module \
57- --with-stream_realip_module \
58- # --with-stream_geoip_module=dynamic \
59- --with-http_slice_module \
60- --with-mail \
61- --with-mail_ssl_module \
62- --with-compat \
63- --with-file-aio \
64- --with-http_v2_module \
65- --add-module=/usr/src/ngx_devel_kit-$DEVEL_KIT_MODULE_VERSION \
66- --add-module=/usr/src/lua-nginx-module-$LUA_MODULE_VERSION \
67- " \
68- && addgroup -S nginx \
69- && adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \
70- && apk add --no-cache --virtual .build-deps \
71- autoconf \
72- gcc \
73- libc-dev \
74- make \
75- libressl-dev \
76- pcre-dev \
77- zlib-dev \
78- linux-headers \
79- curl \
80- gnupg \
81- libxslt-dev \
82- gd-dev \
83- # geoip-dev \
84- libmaxminddb-dev \
85- perl-dev \
86- luajit-dev \
87- && curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \
88- && curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \
89- && curl -fSL https://github.com/simpl/ngx_devel_kit/archive/v$DEVEL_KIT_MODULE_VERSION.tar.gz -o ndk.tar.gz \
90- && curl -fSL https://github.com/openresty/lua-nginx-module/archive/v$LUA_MODULE_VERSION.tar.gz -o lua.tar.gz \
91- # && curl -fSL https://github.com/leev/ngx_http_geoip2_module/archive/$GEOIP2_MODULE_VERSION.tar.gz -o ngx_http_geoip2_module.tar.gz \
92- # && export GNUPGHOME="$(mktemp -d)" \
93- # && found=''; \
94- # for server in \
95- # ha.pool.sks-keyservers.net \
96- # hkp://keyserver.ubuntu.com:80 \
97- # hkp://p80.pool.sks-keyservers.net:80 \
98- # pgp.mit.edu \
99- # ; do \
100- # echo "Fetching GPG key $GPG_KEYS from $server"; \
101- # gpg --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$GPG_KEYS" && found=yes && break; \
102- # done; \
103- # test -z "$found" && echo >&2 "error: failed to fetch GPG key $GPG_KEYS" && exit 1; \
104- # gpg --batch --verify nginx.tar.gz.asc nginx.tar.gz \
105- # && rm -r "$GNUPGHOME" nginx.tar.gz.asc \
106- && mkdir -p /usr/src \
107- && tar -zxC /usr/src -f nginx.tar.gz \
108- && tar -zxC /usr/src -f ndk.tar.gz \
109- && tar -zxC /usr/src -f lua.tar.gz \
110- # && tar -zxC /usr/src -f ngx_http_geoip2_module.tar.gz \
111- # && rm nginx.tar.gz ndk.tar.gz lua.tar.gz ngx_http_geoip2_module.tar.gz \
112- && cd /usr/src/nginx-$NGINX_VERSION \
113- && ./configure $CONFIG --with-debug \
114- && make -j$(getconf _NPROCESSORS_ONLN) \
115- && mv objs/nginx objs/nginx-debug \
116- && mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so \
117- && mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so \
118- # && mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so \
119- && mv objs/ngx_http_perl_module.so objs/ngx_http_perl_module-debug.so \
120- # && mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so \
121- && ./configure $CONFIG \
122- && make -j$(getconf _NPROCESSORS_ONLN) \
123- && make install \
124- && rm -rf /etc/nginx/html/ \
125- && mkdir /etc/nginx/conf.d/ \
126- && mkdir -p /usr/share/nginx/html/ \
127- && install -m644 html/index.html /usr/share/nginx/html/ \
128- && install -m644 html/50x.html /usr/share/nginx/html/ \
129- && install -m755 objs/nginx-debug /usr/sbin/nginx-debug \
130- && install -m755 objs/ngx_http_xslt_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_xslt_filter_module-debug.so \
131- && install -m755 objs/ngx_http_image_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_image_filter_module-debug.so \
132- # && install -m755 objs/ngx_http_geoip_module-debug.so /usr/lib/nginx/modules/ngx_http_geoip_module-debug.so \
133- && install -m755 objs/ngx_http_perl_module-debug.so /usr/lib/nginx/modules/ngx_http_perl_module-debug.so \
134- # && install -m755 objs/ngx_stream_geoip_module-debug.so /usr/lib/nginx/modules/ngx_stream_geoip_module-debug.so \
135- && ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \
136- && strip /usr/sbin/nginx* \
137- && strip /usr/lib/nginx/modules/*.so \
138- && rm -rf /usr/src/nginx-$NGINX_VERSION \
139- # && rm -rf /usr/src/ngx_http_geoip2_module-$GEOIP2_MODULE_VERSION \
140- \
141- # Bring in gettext so we can get `envsubst`, then throw
142- # the rest away. To do this, we need to install `gettext`
143- # then move `envsubst` out of the way so `gettext` can
144- # be deleted completely, then move `envsubst` back.
145- && apk add --no-cache --virtual .gettext gettext \
146- && mv /usr/bin/envsubst /tmp/ \
147- \
148- && runDeps="$( \
149- scanelf --needed --nobanner /usr/sbin/nginx /usr/lib/nginx/modules/*.so /tmp/envsubst \
150- | awk '{ gsub(/,/, " \n so:", $2); print " so:" $2 }' \
151- | sort -u \
152- | xargs -r apk info --installed \
153- | sort -u \
154- )" \
155- && apk add --no-cache --virtual .nginx-rundeps $runDeps \
156- && apk del .build-deps \
157- && apk del .gettext \
158- && mv /tmp/envsubst /usr/local/bin/ \
159- \
160- # forward request and error logs to docker log collector
161- && ln -sf /dev/stdout /var/log/nginx/access.log \
162- && ln -sf /dev/stderr /var/log/nginx/error.log
16+
17+ # INstall nginx + lua and devel kit
18+ RUN apk add --no-cach nginx \
19+ nginx-mod-http-lua \
20+ nginx-mod-devel-kit
16321
16422RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
16523 echo /etc/apk/respositories && \
@@ -175,12 +33,9 @@ RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repo
17533 git \
17634 python3 \
17735 py3-pip \
178- ca-certificates \
17936 dialog \
18037 autoconf \
18138 make \
182- openssl-dev \
183- libressl-dev \
18439 libzip-dev \
18540 bzip2-dev \
18641 icu-dev \
@@ -198,25 +53,29 @@ RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repo
19853 sqlite-dev \
19954 imap-dev \
20055 libjpeg-turbo-dev \
201- postgresql-dev && \
202- docker-php-ext-configure gd \
56+ postgresql-dev \
57+ lua-resty-core
58+
59+ # Install PHP modules
60+ RUN docker-php-ext-configure gd \
20361 --enable-gd \
20462 --with-freetype \
20563 --with-jpeg && \
20664 docker-php-ext-install gd && \
20765 pip install --upgrade pip && \
208- # curl iconv session
209- # docker-php-ext-install pdo_mysql pdo_sqlite mysqli mcrypt gd exif intl xsl json soap dom zip opcache && \
210- # docker-php-ext-install iconv pdo_mysql pdo_sqlite pgsql pdo_pgsql mysqli gd exif intl xsl json soap dom zip opcache && \
21166 docker-php-ext-install pdo_mysql mysqli pdo_sqlite pgsql pdo_pgsql exif intl xsl soap zip && \
212- pecl install xdebug-3.1.4 && \
213- pecl install -o -f redis && \
67+ pecl install -o -f xdebug && \
68+ pecl install -o -f redis && \
21469 echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini && \
215- docker-php-source delete && \
216- mkdir -p /etc/nginx && \
217- mkdir -p /var/www/app && \
218- mkdir -p /run/nginx && \
219- mkdir -p /var/log/supervisor && \
70+ echo "zend_extension=xdebug" > /usr/local/etc/php/conf.d/xdebug.ini && \
71+ docker-php-source delete
72+ # mkdir -p /etc/nginx && \
73+ # mkdir -p /var/www/app && \
74+ # mkdir -p /run/nginx && \
75+
76+
77+ # Install composer and certbot
78+ RUN mkdir -p /var/log/supervisor && \
22079 php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
22180 php composer-setup.php --quiet --install-dir=/usr/bin --filename=composer && \
22281 rm composer-setup.php &&\
@@ -225,7 +84,6 @@ RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repo
22584 mkdir -p /etc/letsencrypt/webrootauth && \
22685 apk del gcc musl-dev linux-headers libffi-dev augeas-dev python3-dev make autoconf && \
22786 apk del .sys-deps
228- # ln -s /usr/bin/php7 /usr/bin/php
22987
23088ADD conf/supervisord.conf /etc/supervisord.conf
23189
0 commit comments