Skip to content

Commit

Permalink
Merge pull request #2 from tulibraries/Deploy_to_kubernetes
Browse files Browse the repository at this point in the history
Deploy to Kubernetes
  • Loading branch information
nomadicoder authored Aug 11, 2021
2 parents b3923e1 + ac08930 commit e161e3a
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 29 deletions.
53 changes: 24 additions & 29 deletions .docker/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,34 @@ FROM php:7.4-apache-buster
RUN a2enmod rewrite

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -qq update && apt-get -qq -y upgrade
RUN apt-get -qq update && apt-get -qq -y --no-install-recommends install \
unzip \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
libjpeg-dev \
libmemcached-dev \
zlib1g-dev \
imagemagick \
libmagickwand-dev \
wget \
ghostscript \
poppler-utils

# Install the PHP extensions we need
RUN docker-php-ext-configure gd --with-jpeg=/usr/include/ --with-freetype=/usr/include/
RUN docker-php-ext-install -j$(nproc) iconv pdo pdo_mysql mysqli gd
RUN yes | pecl install mcrypt-1.0.3 && docker-php-ext-enable mcrypt && yes | pecl install imagick && docker-php-ext-enable imagick

# Add the Omeka-S PHP code
# Latest Omeka version, check: https://omeka.org/s/download/
RUN wget --no-verbose "https://github.com/omeka/omeka-s/releases/download/v3.0.2/omeka-s-3.0.2.zip" -O /var/www/latest_omeka_s.zip
RUN unzip -q /var/www/latest_omeka_s.zip -d /var/www/ \
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get -qq update \
&& apt-get -qq -y --no-install-recommends install \
unzip=6.0-23+deb10u2 \
libfreetype6-dev=2.9.1-3+deb10u2 \
libjpeg62-turbo-dev=1:1.5.2-2+deb10u1 \
libmcrypt-dev=2.5.8-3.4 \
libpng-dev=1.6.36-6 \
libjpeg-dev=1:1.5.2-2+deb10u1 \
libmemcached-dev=1.0.18-4.2 \
zlib1g-dev=1:1.2.11.dfsg-1 \
imagemagick=8:6.9.10.23+dfsg-2.1+deb10u1 \
libmagickwand-dev=8:6.9.10.23+dfsg-2.1+deb10u1 \
wget=1.20.1-1.1 \
ghostscript=9.27~dfsg-2+deb10u4 \
poppler-utils=0.71.0-5 \
&& docker-php-ext-configure gd --with-jpeg=/usr/include/ --with-freetype=/usr/include/ \
&& docker-php-ext-install -j"$(nproc)" iconv pdo pdo_mysql mysqli gd \
&& yes | pecl install mcrypt-1.0.3 && docker-php-ext-enable mcrypt && yes | pecl install imagick && docker-php-ext-enable imagick \
&& wget --no-verbose "https://github.com/omeka/omeka-s/releases/download/v3.0.2/omeka-s-3.0.2.zip" -O /var/www/latest_omeka_s.zip \
&& unzip -q /var/www/latest_omeka_s.zip -d /var/www/ \
&& rm /var/www/latest_omeka_s.zip \
&& rm -rf /var/www/html/ \
&& mv /var/www/omeka-s/ /var/www/html/

COPY ./imagemagick-policy.xml /etc/ImageMagick-6/policy.xml
COPY ./.htaccess /var/www/html/.htaccess


# Create one volume for files, config, themes and modules
RUN mkdir -p /var/www/html/volume/config/ && mkdir -p /var/www/html/volume/files/ && mkdir -p /var/www/html/volume/modules/ && mkdir -p /var/www/html/volume/themes/

Expand All @@ -58,9 +53,9 @@ RUN rm /var/www/html/config/database.ini \
&& chown -R www-data:www-data /var/www/html/ \
&& chmod 600 /var/www/html/volume/config/database.ini \
&& chmod 600 /var/www/html/volume/config/local.config.php \
&& chmod 600 /var/www/html/.htaccess
&& chmod 600 /var/www/html/.htaccess \
%% echo "ServerName localhost" >> /etc/apache2/apache2.conf

VOLUME /var/www/html/volume/
\
CMD echo "ServerName localhost" >> /etc/apache2/apache2.conf

CMD ["apache2-foreground"]
36 changes: 36 additions & 0 deletions .docker/app/Dockerfile-2017
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM php:7.1-apache

RUN a2enmod rewrite

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -qq update && \
apt-get -qq -y --no-install-recommends install \
curl=7.64.0-4+deb10u2 \
unzip=6.0-23+deb10u2 \
libfreetype6-dev=2.9.1-3+deb10u2 \
libjpeg62-turbo-dev=1:1.5.2-2+deb10u1 \
libmcrypt-dev=2.5.8-3.4 \
libpng-dev=1.6.36-6 \
libjpeg-dev=1:1.5.2-2+deb10u1 \
libmemcached-dev=1.0.18-4.2 \
zlib1g-dev=1:1.2.11.dfsg-1 \
imagemagick=8:6.9.10.23+dfsg-2.1+deb10u1 && \
docker-php-ext-install "-j$(nproc)" iconv mcrypt \
pdo pdo_mysql mysqli gd && \
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
curl -J -L -s -k \
'https://github.com/omeka/omeka-s/releases/download/v3.0.2/omeka-s-3.0.2.zip' \
-o /var/www/omeka-s.zip && \
unzip -q /var/www/omeka-s.zip -d /var/www/ && \
rm /var/www/omeka-s.zip && \
rm -rf /var/www/html && \
mv /var/www/omeka-s /var/www/html && \
chown -R www-data:www-data /var/www/html

COPY ./database.ini /var/www/html/config/database.ini
COPY ./imagemagick-policy.xml /etc/ImageMagick/policy.xml
COPY ./.htaccess /var/www/html/.htaccess

VOLUME /var/www/html

CMD ["apache2-foreground"]
Empty file added modules/.keep
Empty file.

0 comments on commit e161e3a

Please sign in to comment.