From 5ff1c0e38943a51cf1b9e56e8387ea60f0b5eaf0 Mon Sep 17 00:00:00 2001 From: R0GGER Date: Sun, 28 Sep 2025 16:13:45 +0200 Subject: [PATCH] docker image --- Dockerfile | 18 ++++++++++++++---- docker-compose.yml | 15 +-------------- docker/entrypoint.sh | 9 +++++++++ docker/php.ini | 2 ++ 4 files changed, 26 insertions(+), 18 deletions(-) create mode 100644 docker/entrypoint.sh create mode 100644 docker/php.ini diff --git a/Dockerfile b/Dockerfile index 87f9671..4a1335f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,29 @@ -FROM tobi312/php:8.4-apache +FROM php:8.3-apache + +# Install system dependencies and PHP extensions +RUN apt-get update && apt-get install -y \ + libsqlite3-dev \ + libzip-dev \ + unzip \ + && docker-php-ext-install pdo_sqlite zip # Set DocumentRoot -ENV APACHE_DOCUMENT_ROOT /var/www/html +ENV APACHE_DOCUMENT_ROOT=/var/www/html # Copy application files COPY . /var/www/html +# Copy custom PHP configuration +COPY /docker/php.ini /usr/local/etc/php/conf.d/php.ini + # Create data directories and set permissions RUN mkdir -p /var/www/html/data/database /var/www/html/data/images/custom /var/www/html/data/images/backgrounds && \ chmod -R 775 /var/www/html/data # Copy and set up entrypoint -COPY entrypoint.sh /usr/local/bin/entrypoint.sh +COPY /docker/entrypoint.sh /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh -ENTRYPOINT ["entrypoint.sh"] +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] # Expose port and start Apache EXPOSE 80 diff --git a/docker-compose.yml b/docker-compose.yml index 10c26b6..3815316 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,20 +9,7 @@ services: - .:/var/www/html:rw environment: TZ: "Europe/Amsterdam" - PHP_ERRORS: 1 - PHP_MEM_LIMIT: 128 - PHP_POST_MAX_SIZE: 250 - PHP_UPLOAD_MAX_FILESIZE: 25 - PHP_MAX_FILE_UPLOADS: 20 - CREATE_PHPINFO_FILE: 0 - CREATE_INDEX_FILE: 0 - ENABLE_APACHE_REWRITE: 1 - ENABLE_APACHE_ACTIONS: 0 - ENABLE_APACHE_SSL: 0 - ENABLE_APACHE_HEADERS: 0 - ENABLE_APACHE_ALLOWOVERRIDE: 1 - ENABLE_APACHE_REMOTEIP: 0 - ENABLE_APACHE_STATUS: 0 + # favicon-downloader: # ports: # - 3000:3000 diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 0000000..61e444d --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -e + +# Set permissions on the data directory +chown -R www-data:www-data /var/www/html/data +chmod -R 775 /var/www/html/data + +# Execute the CMD from the Dockerfile, or the command passed to `docker run` +exec "$@" diff --git a/docker/php.ini b/docker/php.ini new file mode 100644 index 0000000..9253932 --- /dev/null +++ b/docker/php.ini @@ -0,0 +1,2 @@ +upload_max_filesize = 100M +post_max_size = 100M