From 348c077dccd4266220d05a4b6b97fb6f466ee5e2 Mon Sep 17 00:00:00 2001 From: johackim Date: Wed, 3 Jul 2024 20:49:13 +0200 Subject: [PATCH] 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 "$@"