preparations and testing for a rewrite, ditching wkhtmltopdf for chrome-driver
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
:80 {
|
||||
root * /srv
|
||||
root * /srv/web
|
||||
php_fastcgi 127.0.0.1:9000
|
||||
file_server
|
||||
|
||||
try_files {path} {path}/ /index.php?{query}
|
||||
}
|
@ -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"]
|
||||
|
25
docker/start.sh
Normal file
25
docker/start.sh
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
echo ' [+] Starting php'
|
||||
php-fpm83
|
||||
|
||||
cd /srv/src
|
||||
composer install
|
||||
|
||||
echo ' [+] Starting Chrome'
|
||||
chromedriver --port=4444 &
|
||||
|
||||
|
||||
chmod 777 /srv/cache
|
||||
chmod 777 /srv/logs
|
||||
|
||||
echo ' [+] Building config'
|
||||
_buildConfig() {
|
||||
echo "<?php"
|
||||
echo "date_default_timezone_set('Europe/Vienna');"
|
||||
echo "define('URL','${URL:-http://localhost:8080}');"
|
||||
echo ""
|
||||
}
|
||||
|
||||
_buildConfig > src/inc/config.inc.php
|
||||
|
||||
caddy run --config /etc/caddy/Caddyfile
|
Reference in New Issue
Block a user