diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..e8d3f0650 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,43 @@ +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 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 echo "upload_max_filesize = 25M\npost_max_size = 25M" > /usr/local/etc/php/conf.d/uploads.ini + +RUN npx gulp init + +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 + +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 "$@"