docker-paheko/Dockerfile

103 lines
2.9 KiB
Docker

ARG ALPINE_VERSION=3.17
FROM alpine:${ALPINE_VERSION}
LABEL Maintainer="lefuturiste"
LABEL Description="Paheko on Alpine Linux with Docker"
# BORDEL DE MERDE, CEST APRES LES FROM POUR AVOIR LA VARIABLE EN BAS
ARG PAHEKO_VERSION=1.3.0-rc10
VOLUME /var/www/paheko/data
WORKDIR /var/www/
RUN apk add --no-cache \
curl \
nginx \
php81 \
php81-ctype \
php81-curl \
php81-dom \
php81-fpm \
php81-gd \
php81-intl \
php81-mbstring \
php81-opcache \
php81-openssl \
php81-phar \
php81-session \
php81-sqlite3 \
php81-pdo_sqlite \
php81-fileinfo \
php81-json \
php81-openssl \
php81-xml \
php81-xmlreader \
php81-zlib \
php81-zip \
supervisor \
gettext
# BUILD the php-gnupg extension
RUN apk add --no-cache git make php81-dev build-base gpgme-dev
WORKDIR /tmp
RUN git clone --recursive https://github.com/php-gnupg/php-gnupg.git && cd php-gnupg \
&& phpize && ./configure && make && make install
WORKDIR /var/www/
# Downloading and installing paheko
# https://fossil.kd2.org/paheko/uv/paheko-1.3.0-rc10.tar.gz
RUN curl -v -L -O "https://fossil.kd2.org/paheko/uv/paheko-${PAHEKO_VERSION}.tar.gz"
RUN tar xf paheko-${PAHEKO_VERSION}.tar.gz
RUN rm -rf *.tar.gz
RUN mv paheko-${PAHEKO_VERSION} /var/www/paheko
RUN echo ${PAHEKO_VERSION} > /paheko_version
RUN cat /var/www/paheko/VERSION
# apply quick patch
COPY ./patchs /patchs
RUN cd paheko && patch -p1 < /patchs/plugins.patch
# Download and install plugins
RUN cd /var/www/paheko/data/plugins && curl -L -O https://fossil.kd2.org/paheko-plugins/uv/helloasso.tar.gz
# Create symlink so programs depending on `php` still function
# RUN ln -s /usr/bin/php81 /usr/bin/php
# Configure nginx
RUN rm /etc/nginx/http.d/default.conf # remove this file because it listens on port 80 and it blocks other vhost
COPY config/nginx-paheko.conf /etc/nginx/http.d
# Configure PHP (seems useless)
# to have the function finfo_open (uncomment ;extension=fileinfo)
#COPY config/php.ini /etc/php81/php.ini
# Configure PHP-FPM
COPY config/fpm-paheko.conf /etc/php81/php-fpm.d/
# Configure timezone
COPY config/php-custom.ini /etc/php81/conf.d/custom.ini
# Configure supervisord
COPY config/supervisord.conf /etc/supervisord.conf
#COPY supervisord.conf /etc/supervisord.conf
## Make sure files/folders needed by the processes are accessable when they run under the nobody user
RUN chown -R nobody: /run /var/lib/nginx /var/log/nginx /var/www/paheko
# Switch to use a non-root user from here on
USER nobody
# Expose the port nginx is reachable on (documentation purposes only)
EXPOSE 80
## Let supervisord start nginx & php-fpm
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
#CMD ["/usr/bin/supervisord"] # should work too
#CMD ["nginx", "-g", "daemon off;"] # to start nginx only
# Configure a healthcheck to validate that everything is up&running
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8080/fpm-ping
# when curl fails to get an anwser, `docker ps` shows an "unhealthy" status