Skip to content

Commit

Permalink
feat: add docker support
Browse files Browse the repository at this point in the history
  • Loading branch information
johackim committed Nov 15, 2024
1 parent e1564e4 commit 348c077
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
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 "$@"

0 comments on commit 348c077

Please sign in to comment.