omeka/Dockerfile

180 lines
6.7 KiB
Docker
Raw Permalink Normal View History

FROM debian:stable-slim as builder
ARG PHP_VERSION=8.1
ARG NODE_VERSION=18
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y git curl ca-certificates
WORKDIR omeka
RUN git clone --depth 1 --recursive https://github.com/omeka/omeka-s.git
RUN chmod 775 omeka-s
WORKDIR /omeka/omeka-s
SHELL ["/bin/bash", "-c"]
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
## Install Older version
RUN apt-get -y install lsb-release ca-certificates curl
RUN curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
RUN sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
RUN apt-get update && \
apt-get -qy install \
php${PHP_VERSION}-fpm php${PHP_VERSION}-mysql php${PHP_VERSION}-curl php${PHP_VERSION}-gd php${PHP_VERSION}-mbstring php${PHP_VERSION}-xml php${PHP_VERSION}-xmlrpc php${PHP_VERSION}-soap php${PHP_VERSION}-intl php${PHP_VERSION}-zip php${PHP_VERSION}-imagick\
ghostscript git wget sudo curl openssl imagemagick\
poppler-utils && \
apt-get clean
RUN cp /usr/sbin/php-fpm${PHP_VERSION} /usr/sbin/php-fpm
RUN export NVM_DIR="$HOME/.nvm" \
&& \. "$NVM_DIR/nvm.sh" \
&& nvm install stable \
&& npm install \
&& npx gulp init
# Composer PHP
RUN apt-get install -qy wget php${PHP_VERSION}-cli php${PHP_VERSION}-zip unzip && \
wget -O /tmp/composer-setup.php https://getcomposer.org/installer && \
php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer && \
composer self-update
# Install modules Nov 2020
RUN apt-get -qy install wget unzip
# oai pmh module
RUN wget https://github.com/Daniel-KM/Omeka-S-module-OaiPmhRepository/releases/download/3.4.7/OaiPmhRepository-3.4.7.zip -O /tmp/oaipmh.zip
RUN unzip /tmp/oaipmh.zip -d modules/
# import from omeka 2
RUN wget https://github.com/omeka-s-modules/Omeka2Importer/releases/download/v1.5.1/Omeka2Importer-1.5.1.zip -O /tmp/importer.zip
RUN unzip /tmp/importer.zip -d modules/
# bulk edition
RUN wget https://github.com/Daniel-KM/Omeka-S-module-BulkEdit/releases/download/3.4.26/BulkEdit-3.4.26.zip -O /tmp/bulkedit.zip
RUN unzip /tmp/bulkedit.zip -d modules/
# Easy Admin
RUN wget https://github.com/Daniel-KM/Omeka-S-module-EasyAdmin/releases/download/3.4.16/EasyAdmin-3.4.16.zip -O /tmp/EasyAdmin.zip
RUN unzip /tmp/EasyAdmin.zip -d modules/
# custom vocab
RUN wget https://github.com/omeka-s-modules/CustomVocab/releases/download/v2.0.2/CustomVocab-2.0.2.zip -O /tmp/customvocab.zip
RUN unzip /tmp/customvocab.zip -d modules/
2024-03-23 15:43:58 +01:00
# Reference
RUN wget https://github.com/Daniel-KM/Omeka-S-module-Reference/releases/download/3.4.47/Reference-3.4.47.zip -O /tmp/Reference.zip
RUN unzip /tmp/Reference.zip -d modules/
# Advanced Search
2024-03-23 15:43:58 +01:00
RUN wget https://github.com/Daniel-KM/Omeka-S-module-AdvancedSearch/releases/download/3.4.20/AdvancedSearch-3.4.20.zip -O /tmp/AdvancedSearch.zip
RUN unzip /tmp/AdvancedSearch.zip -d modules/
RUN wget https://github.com/omeka-s-modules/MetadataBrowse/releases/download/v1.6.0/MetadataBrowse-1.6.0.zip -O /tmp/MetadataBrowse.zip
RUN unzip /tmp/MetadataBrowse.zip -d modules/
# SiteSlug as Domain
RUN git clone https://github.com/kyfr59/omeka-s-module-SiteSlugAsSubdomain.git modules/SiteSlugAsSubdomain
# ValueSuggest
RUN git clone https://github.com/omeka-s-modules/ValueSuggest.git modules/ValueSuggest
# Rights Statements
RUN git clone https://github.com/zerocrates/RightsStatements.git modules/RightsStatements
# Mapping
2024-03-23 15:43:58 +01:00
RUN wget https://github.com/omeka-s-modules/Mapping/releases/download/v1.10.0/Mapping-1.10.0.zip -O /tmp/Mapping.zip
RUN unzip /tmp/Mapping.zip -d modules/
# Need build https://omeka.org/s/modules/Mapping/:
# RUN git clone https://github.com/omeka-s-modules/Mapping.git modules/Mapping
# CSS Editor
RUN git clone https://github.com/omeka-s-modules/CSSEditor.git modules/CSSEditor
# extract pdf content to text field
RUN git clone https://github.com/omeka-s-modules/ExtractText.git modules/ExtractText
# Comments
RUN git clone https://gitlab.com/Daniel-KM/Omeka-S-module-Comment.git modules/Comment
# Blocks Disposition / Generic / Folksonomy
RUN git clone https://github.com/Daniel-KM/Omeka-S-module-BlocksDisposition.git modules/BlocksDisposition
RUN git clone https://gitlab.com/Daniel-KM/Omeka-S-module-Generic.git modules/Generic
RUN git clone https://github.com/Daniel-KM/Omeka-S-module-Folksonomy.git modules/Folksonomy
2024-03-23 15:43:58 +01:00
# Common required by Easy Admin
RUN git clone https://gitlab.com/Daniel-KM/Omeka-S-module-Common.git modules/Common
# Numeric Data Types for timestamp
RUN wget https://github.com/omeka-s-modules/NumericDataTypes/releases/download/v1.11.3/NumericDataTypes-1.11.3.zip -O /tmp/NumericDataTypes.zip
RUN unzip /tmp/NumericDataTypes.zip -d modules/
RUN rm -rf /tmp/*.zip
### < END BUILDER > ###
FROM debian:stable-slim
ARG PHP_VERSION=8.1
# Install dependencies
ENV DEBIAN_FRONTEND noninteractive
## Install Older version
RUN apt-get update && \
apt-get -y install lsb-release ca-certificates curl
RUN curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
RUN sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
RUN apt-get update && \
apt-get -qy install \
2024-03-23 15:43:58 +01:00
php${PHP_VERSION}-fpm php${PHP_VERSION}-mysql php${PHP_VERSION}-curl php${PHP_VERSION}-gd php${PHP_VERSION}-mbstring php${PHP_VERSION}-xml php${PHP_VERSION}-xmlrpc php${PHP_VERSION}-soap php${PHP_VERSION}-intl php${PHP_VERSION}-zip php${PHP_VERSION}-imagick php${PHP_VERSION}-apcu \
ghostscript git wget sudo curl openssl imagemagick\
poppler-utils && \
apt-get clean
RUN update-alternatives --install /usr/bin/php php /usr/bin/php${PHP_VERSION} 99 --force
RUN update-alternatives --set php /usr/bin/php${PHP_VERSION}
RUN cp /usr/sbin/php-fpm${PHP_VERSION} /usr/sbin/php-fpm
RUN apt install -y \
apache2 apache2-utils libapache2-mod-php${PHP_VERSION}
RUN a2enmod rewrite alias authz_user ssl headers
RUN useradd omeka -d /var/www/html/ && \
adduser omeka www-data && \
adduser omeka users
RUN chown -R omeka:users /var/log/apache2
RUN chmod -R 777 /var/lib/php/sessions
# Extract Text
RUN apt-get -qy install catdoc docx2txt lynx odt2txt poppler-utils
# Install omeka
WORKDIR /var/www/html/omeka-s
2024-03-23 15:43:58 +01:00
RUN chown -R omeka:omeka /var/www/html/omeka-s
COPY --from=builder --chown=omeka:omeka /omeka/omeka-s /var/www/html/omeka-s
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
2024-03-23 15:43:58 +01:00
COPY ./envvars /etc/apache2/envvars
COPY ./omeka.apache2.conf /etc/apache2/sites-available/000-default.conf
EXPOSE 80
VOLUME /var/www/html/omeka-s/files
ENTRYPOINT ["/bin/bash","/usr/local/bin/docker-entrypoint.sh"]
CMD ["apachectl","-D","FOREGROUND"]