paheko_docker_image_builder/Dockerfile

51 lines
2.1 KiB
Docker

FROM php:8.3.7-apache-bookworm
LABEL Maintainer="Libretic"
LABEL Description="Official Docker image for Paheko."
ENV APACHE_DOCUMENT_ROOT /var/www/paheko/www
# Required PHP extensions and packages
RUN apt-get update && \
apt-get install -y libicu-dev zlib1g-dev libpng-dev libzip-dev libfreetype6-dev libjpeg62-turbo-dev chromium && \
docker-php-ext-configure gd --with-freetype --with-jpeg && \
docker-php-ext-install -j$(nproc) gd intl zip opcache
# Enable Apache rewrite module
RUN a2enmod rewrite
ARG PAHEKO_VERSION
ENV PAHEKO_VERSION=$PAHEKO_VERSION
# Downloading and installing Paheko
RUN cd /var/www && \
curl -L -O https://fossil.kd2.org/paheko/uv/paheko-$PAHEKO_VERSION.tar.gz && \
tar xzvf paheko-$PAHEKO_VERSION.tar.gz && \
mv paheko-$PAHEKO_VERSION /var/www/paheko && \
chown -R www-data: /var/www/paheko && \
rm -f paheko-$PAHEKO_VERSION.tar.gz
# Downloading plugins
RUN cd /var/www/paheko/data/plugins/ && \
curl -L -O https://fossil.kd2.org/paheko-plugins/uv/stock_velos.tar.gz ; \
curl -L -O https://fossil.kd2.org/paheko-plugins/uv/reservations.tar.gz ; \
curl -L -O https://fossil.kd2.org/paheko-plugins/uv/webstats.tar.gz ; \
curl -L -O https://fossil.kd2.org/paheko-plugins/uv/git_documents.tar.gz ; \
curl -L -O https://fossil.kd2.org/paheko-plugins/uv/taima.tar.gz ; \
curl -L -O https://fossil.kd2.org/paheko-plugins/uv/caisse.tar.gz ; \
curl -L -O https://fossil.kd2.org/paheko-plugins/uv/helloasso.tar.gz ; \
chown -R www-data: /var/www/paheko/data/plugins
# Change apache documentroot
RUN sed -ri "s#/var/www/html#/var/www/paheko/www#g" /etc/apache2/sites-available/*.conf
RUN sed -ri -e "s#/var/www/#/var/www/paheko/www/#g" /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
# Prepare .config dir for chromium
RUN mkdir /.config && \
chown -R www-data: /.config
# Prepare apache .htaccess and virtualhost
COPY .htaccess /var/www/paheko/www/
COPY 000-default.conf /etc/apache2/sites-available/000-default.conf
# Test apache responds to validate that everything is up&running
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1/admin/