Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add docker support #2209

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
13 changes: 13 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"