| ADD alpine-minirootfs-3.19.9-x86_64.tar.gz / # buildkit |
| CMD ["/bin/sh"] |
| LABEL maintainer=Dean Ward |
| ARG TARGETARCH=amd64 |
| ARG VERSION=0.2.14 |
| ENV APP_VERSION=0.2.14 |
| WORKDIR /var/www/html |
| ENV TZ=UTC |
| ENV SUPERVISOR_PHP_FPM_COMMAND=/usr/sbin/php-fpm83 -F |
| ENV SUPERVISOR_CADDY_COMMAND=/usr/sbin/caddy run --config /etc/caddy/Caddyfile |
| ENV SUPERVISOR_PHP_USER=erugo |
| RUN |2 TARGETARCH=amd64 VERSION=0.2.14 /bin/sh -c echo "http://dl-cdn.alpinelinux.org/alpine/v3.19/community" >> /etc/apk/repositories # buildkit |
| RUN |2 TARGETARCH=amd64 VERSION=0.2.14 /bin/sh -c apk add --no-cache curl su-exec sudo supervisor cronie ffmpeg php83 php83-pdo_pgsql php83-pdo_sqlite php83-gd php83-curl php83-pecl-mongodb php83-imap php83-pdo_mysql php83-mbstring php83-xml php83-zip php83-bcmath php83-soap php83-intl php83-ldap php83-pecl-redis php83-pecl-memcached php83-phar php83-openssl php83-json php83-dom php83-tokenizer php83-fileinfo tzdata libcap zip php83-fpm caddy && ln -s /usr/bin/php83 /usr/bin/php && rm -rf /var/cache/apk/* # buildkit |
| ENV TUSD_VERSION=2.6.0 |
| RUN |2 TARGETARCH=amd64 VERSION=0.2.14 /bin/sh -c TUSD_ARCH="${TARGETARCH}" && if [ "$TUSD_ARCH" = "amd64" ]; then TUSD_ARCH="amd64"; elif [ "$TUSD_ARCH" = "arm64" ]; then TUSD_ARCH="arm64"; else echo "Unsupported architecture: $TARGETARCH" && exit 1; fi && curl -L -o /tmp/tusd.tar.gz "https://github.com/tus/tusd/releases/download/v${TUSD_VERSION}/tusd_linux_${TUSD_ARCH}.tar.gz" && tar -xzf /tmp/tusd.tar.gz -C /tmp && mv /tmp/tusd_linux_${TUSD_ARCH}/tusd /usr/local/bin/tusd && chmod +x /usr/local/bin/tusd && rm -rf /tmp/tusd.tar.gz /tmp/tusd_linux_${TUSD_ARCH} # buildkit |
| RUN |2 TARGETARCH=amd64 VERSION=0.2.14 /bin/sh -c mkdir -p /run/php /var/www/html/public /etc/php83/php-fpm.d /etc/caddy # buildkit |
| COPY ./docker/alpine/www.conf /etc/php83/php-fpm.d/www.conf # buildkit |
| COPY ./docker/alpine/Caddyfile /etc/caddy/Caddyfile # buildkit |
| RUN |2 TARGETARCH=amd64 VERSION=0.2.14 /bin/sh -c ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone # buildkit |
| RUN |2 TARGETARCH=amd64 VERSION=0.2.14 /bin/sh -c setcap "cap_net_bind_service=+ep" /usr/bin/php83 # buildkit |
| RUN |2 TARGETARCH=amd64 VERSION=0.2.14 /bin/sh -c addgroup erugo && adduser -D -G erugo erugo # buildkit |
| RUN |2 TARGETARCH=amd64 VERSION=0.2.14 /bin/sh -c chown -R erugo:erugo /run/php # buildkit |
| COPY --chown=erugo:erugo . /var/www/html/ # buildkit |
| COPY /app/vendor /var/www/html/vendor # buildkit |
| COPY /app/public/build /var/www/html/public/build # buildkit |
| RUN |2 TARGETARCH=amd64 VERSION=0.2.14 /bin/sh -c rm -rf /var/www/html/.env /var/www/html/.git /var/www/html/node_modules /var/www/html/storage # buildkit |
| RUN |2 TARGETARCH=amd64 VERSION=0.2.14 /bin/sh -c echo "* * * * * cd /var/www/html && php artisan schedule:run >> /dev/null 2>&1" | crontab -u erugo - # buildkit |
| COPY ./docker/alpine/start-container /usr/local/bin/start-container # buildkit |
| COPY ./docker/alpine/supervisord.conf /etc/supervisor/conf.d/supervisord.conf # buildkit |
| COPY ./docker/alpine/php.ini /etc/php83/conf.d/99-erugo.ini # buildkit |
| RUN |2 TARGETARCH=amd64 VERSION=0.2.14 /bin/sh -c chmod +x /usr/local/bin/start-container # buildkit |
| RUN |2 TARGETARCH=amd64 VERSION=0.2.14 /bin/sh -c mkdir -p /var/log/supervisor # buildkit |
| EXPOSE map[80/tcp:{}] |
| ENTRYPOINT ["start-container"] |