1+ FROM bandsintown/alpine:3.19.1 as builder
2+
13FROM surnet/alpine-wkhtmltopdf:3.19.0-0.12.6-full as wkhtmltopdf
24
35FROM php:8.4.16-fpm-alpine
46
5- ENV S6_LOGGING=1 S6_OVERLAY_VERSION=1.19.1.1 GODNSMASQ_VERSION=1.0.7 CONSUL_TEMPLATE_VERSION=0.32.0 CONSUL_VERSION=1.15.0 MEMCACHED_DEPS="zlib-dev libmemcached-dev cyrus-sasl-dev" TZ="America/New_York"
6-
7- # Download architecture-specific binaries (newer versions with ARM64 support)
8- RUN apk add --no-cache unzip && \
9- ARCH=$(uname -m) && \
10- if [ "$ARCH" = "x86_64" ]; then CONSUL_ARCH="amd64" ; \
11- elif [ "$ARCH" = "aarch64" ]; then CONSUL_ARCH="arm64" ; \
12- else CONSUL_ARCH="amd64" ; fi && \
13- # Download consul
14- wget -O /tmp/consul.zip https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_${CONSUL_ARCH}.zip && \
15- unzip /tmp/consul.zip -d /usr/local/bin && \
16- rm /tmp/consul.zip && \
17- # Download consul-template
18- wget -O /tmp/consul-template.zip https://releases.hashicorp.com/consul-template/${CONSUL_TEMPLATE_VERSION}/consul-template_${CONSUL_TEMPLATE_VERSION}_linux_${CONSUL_ARCH}.zip && \
19- unzip /tmp/consul-template.zip -d /usr/local/bin && \
20- rm /tmp/consul-template.zip && \
21- chmod +x /usr/local/bin/consul /usr/local/bin/consul-template && \
22- apk del unzip
7+ ENV S6_LOGGING=1 S6_OVERLAY_VERSION=1.19.1.1 GODNSMASQ_VERSION=1.0.7 CONSUL_TEMPLATE_VERSION=0.19.4 CONSUL_VERSION=0.8.4 MEMCACHED_DEPS="zlib-dev libmemcached-dev cyrus-sasl-dev" TZ="America/New_York"
238
24- # Copy s6 overlay configs (these are just scripts, not binaries)
25- RUN mkdir -p /etc/cont-init.d /etc/services.d /root
9+ COPY --from=builder /usr/local/bin/consul /usr/local/bin/consul
10+ COPY --from=builder /usr/local/bin/consul-template /usr/local/bin/consul-template
11+ COPY --from=builder /usr/sbin/go-dnsmasq /usr/sbin/go-dnsmasq
12+ COPY --from=builder /etc/cont-init.d /etc/cont-init.d
13+ COPY --from=builder /etc/services.d /etc/services.d
14+ COPY --from=builder /root /root
2615
2716RUN apk update && apk upgrade \
28- && apk add --no-cache \
17+ && apk add --update \
2918 coreutils \
3019 freetype-dev \
3120 libjpeg-turbo-dev \
32- libtool \
21+ libltdl \
3322 libpng-dev \
34- curl wget bash tree jq bind-tools build-base gcc autoconf \
35- zlib \
36- libmemcached-dev \
37- cyrus-sasl-dev \
38- zlib-dev \
39- linux-headers \
40- $PHPIZE_DEPS \
41- && pecl install memcached-3.3.0 \
42- && docker-php-ext-enable memcached \
23+ curl wget bash tree jq bind-tools su-exec build-base gcc autoconf \
24+ libmemcached-libs zlib \
25+ && set -xe \
26+ && apk add --virtual .phpize-deps $PHPIZE_DEPS \
27+ && apk add --virtual .memcached-deps $MEMCACHED_DEPS \
28+ && pecl install memcached-3.1.4 \
29+ && echo "extension=memcached.so" > /usr/local/etc/php/conf.d/20_memcached.ini \
4330 && pecl install memcache \
44- && docker-php-ext-enable memcache \
31+ && echo "extension= memcache.so" > /usr/local/etc/php/conf.d/21_memcache.ini \
4532 && docker-php-ext-install mysqli \
4633 && docker-php-ext-configure gd --with-freetype --with-jpeg \
4734 && docker-php-ext-install -j$(nproc) gd \
48- && docker-php-ext-install bcmath \
49- && rm -rf /tmp/pear
35+ && rm -rf /usr/share/php8 \
36+ && rm -rf /tmp/* \
37+ && apk del .memcached-deps .phpize-deps
38+
39+ RUN curl -Ls https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-amd64.tar.gz | tar -xz -C /
5040
51- RUN ARCH=$(uname -m) && \
52- if [ "$ARCH" = "x86_64" ]; then S6_ARCH="amd64" ; \
53- elif [ "$ARCH" = "aarch64" ]; then S6_ARCH="aarch64" ; \
54- else S6_ARCH="amd64" ; fi && \
55- curl -Ls https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.gz | tar -xz -C /
41+ RUN mkdir /var/composer && \
42+ cd /var/composer && \
43+ php -r "copy('https://getcomposer.org/download/2.7.3/composer.phar', 'composer-setup.php');" && \
44+ php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
45+ php composer-setup.php --install-dir=/usr/bin --filename=composer && \
46+ php -r "unlink('composer-setup.php');"
5647
57- # Install Composer - disable xdebug during build
58- RUN XDEBUG_MODE=off curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
48+ COPY rootfs /
5949
6050RUN echo $TZ > /etc/timezone \
6151 && touch /usr/local/var/run/php-fpm.pid \
@@ -68,4 +58,4 @@ ENV LOG_STREAM="/tmp/stdout"
6858RUN mkfifo $LOG_STREAM && chmod 777 $LOG_STREAM
6959
7060ENTRYPOINT ["/init" ]
71- CMD ["/bin/sh" , "-c" , "/usr/local/sbin/ php-fpm --pid /usr/local/var/run/php-fpm.pid | tail -f $LOG_STREAM" ]
61+ CMD ["/bin/sh" , "-c" , "php-fpm --pid /usr/local/var/run/php-fpm.pid | tail -f $LOG_STREAM" ]
0 commit comments