preparations and testing for a rewrite, ditching wkhtmltopdf for chrome-driver

This commit is contained in:
2025-01-12 20:13:47 +00:00
parent cf07363a8d
commit f54d35c312
18 changed files with 516 additions and 77 deletions

View File

@ -1,16 +1,29 @@
FROM ghcr.io/surnet/alpine-wkhtmltopdf:3.20.3-0.12.6-full
FROM alpine:3.21
# Install PHP and necessary extensions
RUN apk add --no-cache php83 php83-fpm php83-opcache caddy php83-curl
RUN apk add --no-cache curl php83 php83-fpm php83-opcache caddy php83-curl php83-xdebug chromium-chromedriver
RUN sed -i 's/nobody/caddy/g' /etc/php83/php-fpm.d/www.conf
RUN sed -i 's/E_ALL \& ~E_DEPRECATED \& ~E_STRICT/E_ALL \& ~E_DEPRECATED \& ~E_STRICT \& ~E_NOTICE \& ~E_WARNING/g' /etc/php83/php.ini
# Install additional PHP extensions
RUN apk add --no-cache php83-ctype php83-dom php83-fileinfo php83-gd php83-iconv php83-simplexml php83-xml php83-xmlreader php83-xmlwriter php83-zip php83-phar php83-openssl
RUN curl -sS https://getcomposer.org/installer | /usr/bin/php83 -- --install-dir=/usr/bin --filename=composer
ADD docker/start.sh /start.sh
RUN chmod +x /start.sh
# Copy the contents of the web/ directory to /srv
COPY web/ /srv
ADD . /srv
# Cleanup
RUN rm -rf /srv/.git
RUN rm -rf /srv/.github
RUN rm -rf /srv/.vscode
# Copy the Caddyfile to the container
COPY docker/Caddyfile /etc/caddy/Caddyfile
# Set the default command to start PHP-FPM and Caddy
CMD ["sh", "-c", "php-fpm83 && caddy run --config /etc/caddy/Caddyfile"]
# Run start script
CMD ["sh", "-c", "/start.sh"]