1+ FROM surnet/alpine-wkhtmltopdf:3.19.0-0.12.6-full as wkhtmltopdf
2+
3+ FROM php:8.4.15-fpm-alpine
4+
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
23+
24+ # Copy s6 overlay configs (these are just scripts, not binaries)
25+ RUN mkdir -p /etc/cont-init.d /etc/services.d /root
26+
27+ RUN apk update && apk upgrade \
28+ && apk add --no-cache \
29+ coreutils \
30+ freetype-dev \
31+ libjpeg-turbo-dev \
32+ libtool \
33+ 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 \
43+ && pecl install memcache \
44+ && docker-php-ext-enable memcache \
45+ && docker-php-ext-install mysqli \
46+ && docker-php-ext-configure gd --with-freetype --with-jpeg \
47+ && docker-php-ext-install -j$(nproc) gd \
48+ && docker-php-ext-install bcmath \
49+ && rm -rf /tmp/pear
50+
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 /
56+
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
59+
60+ RUN echo $TZ > /etc/timezone \
61+ && touch /usr/local/var/run/php-fpm.pid \
62+ && echo -ne "- with $(php -v | head -n 1)\n " >> /root/.built
63+
64+ EXPOSE 9000
65+
66+ # Workaround https://bugs.php.net/bug.php?id=71880
67+ ENV LOG_STREAM="/tmp/stdout"
68+ RUN mkfifo $LOG_STREAM && chmod 777 $LOG_STREAM
69+
70+ ENTRYPOINT ["/init" ]
71+ CMD ["/bin/sh" , "-c" , "/usr/local/sbin/php-fpm --pid /usr/local/var/run/php-fpm.pid | tail -f $LOG_STREAM" ]
0 commit comments