From 348c077dccd4266220d05a4b6b97fb6f466ee5e2 Mon Sep 17 00:00:00 2001 From: johackim Date: Wed, 3 Jul 2024 20:49:13 +0200 Subject: [PATCH 1/3] feat: add docker support --- Dockerfile | 35 +++++++++++++++++++++++++++++++++++ docker-entrypoint.sh | 13 +++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 Dockerfile create mode 100755 docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..ff09a92cd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM php:apache + +ENV APACHE_RUN_USER=www-data + +ENV APACHE_RUN_GROUP=www-data + +ENV APACHE_RUN_DIR=/var/run/apache2 + +ENV APACHE_LOG_DIR=/var/log/apache2 + +ENV APACHE_LOCK_DIR=/var/lock/apache2 + +ENV APACHE_PID_FILE=/var/run/apache2/apache2.pid + +RUN apt update && apt install -y git zip unzip libzip-dev libicu-dev nodejs npm + +RUN git clone https://github.com/omeka/omeka-s . + +RUN npm install + +RUN docker-php-ext-install pdo_mysql intl + +RUN npx gulp init + +RUN a2enmod rewrite + +RUN chown -R www-data:www-data /var/www/html/ + +COPY docker-entrypoint.sh . + +VOLUME /var/www/html/files + +CMD ["apache2", "-D", "FOREGROUND"] + +ENTRYPOINT ["./docker-entrypoint.sh"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 000000000..4067e8f77 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +cp config/database.ini.dist config/database.ini + +sed -i -e 's/user = ""/user = "'$MYSQL_USER'"/g' config/database.ini + +sed -i -e 's/password = ""/password = "'$MYSQL_PASSWORD'"/g' config/database.ini + +sed -i -e 's/dbname = ""/dbname = "'$MYSQL_DATABASE'"/g' config/database.ini + +sed -i -e 's/host = ""/host = "'$MYSQL_HOST'"/g' config/database.ini + +exec "$@" From c689571c54ac909869b7f3490999a336796356b4 Mon Sep 17 00:00:00 2001 From: johackim Date: Mon, 14 Oct 2024 19:09:49 +0200 Subject: [PATCH 2/3] feat: add imagemagick --- Dockerfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ff09a92cd..32581b529 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,12 +12,16 @@ ENV APACHE_LOCK_DIR=/var/lock/apache2 ENV APACHE_PID_FILE=/var/run/apache2/apache2.pid -RUN apt update && apt install -y git zip unzip libzip-dev libicu-dev nodejs npm +RUN apt update && apt install -y git zip unzip libzip-dev libicu-dev libmagickwand-dev imagemagick nodejs npm RUN git clone https://github.com/omeka/omeka-s . RUN npm install +RUN yes '' | pecl install imagick + +RUN docker-php-ext-enable imagick + RUN docker-php-ext-install pdo_mysql intl RUN npx gulp init @@ -26,6 +30,8 @@ RUN a2enmod rewrite RUN chown -R www-data:www-data /var/www/html/ +RUN apt-get clean && rm -rf /var/lib/apt/lists/* + COPY docker-entrypoint.sh . VOLUME /var/www/html/files From 8691454a80d4eb512e99ab8e73da29d8b78cfb92 Mon Sep 17 00:00:00 2001 From: johackim Date: Fri, 15 Nov 2024 18:14:39 +0100 Subject: [PATCH 3/3] feat: increase upload size limits --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 32581b529..e8d3f0650 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,8 @@ RUN docker-php-ext-enable imagick RUN docker-php-ext-install pdo_mysql intl +RUN echo "upload_max_filesize = 25M\npost_max_size = 25M" > /usr/local/etc/php/conf.d/uploads.ini + RUN npx gulp init RUN a2enmod rewrite