docker-paheko/Dockerfile

104 lines
2.9 KiB
Text
Raw Normal View History

2023-02-18 21:03:59 +00:00
ARG ALPINE_VERSION=3.17
2023-09-17 14:18:01 +00:00
2023-02-18 21:03:59 +00:00
FROM alpine:${ALPINE_VERSION}
2023-09-17 14:18:01 +00:00
LABEL Maintainer="lefuturiste"
2023-02-18 21:09:06 +00:00
LABEL Description="Paheko on Alpine Linux with Docker"
2023-02-18 21:03:59 +00:00
2023-09-17 14:18:01 +00:00
# BORDEL DE MERDE, CEST APRES LES FROM POUR AVOIR LA VARIABLE EN BAS
ARG PAHEKO_VERSION=1.3.0-rc10
2023-02-18 21:59:08 +00:00
2023-09-17 14:18:01 +00:00
VOLUME /var/www/paheko/data
2023-02-18 21:03:59 +00:00
2023-09-17 14:18:01 +00:00
WORKDIR /var/www/
2023-02-18 21:03:59 +00:00
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 \
2023-09-17 14:18:01 +00:00
php81-pdo_sqlite \
2023-02-18 21:03:59 +00:00
php81-fileinfo \
php81-json \
php81-openssl \
php81-xml \
php81-xmlreader \
php81-zlib \
php81-zip \
supervisor \
gettext
2023-09-17 14:18:01 +00:00
# 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
2023-02-18 21:03:59 +00:00
# Download and install plugins
2023-09-17 14:18:01 +00:00
RUN cd /var/www/paheko/data/plugins && curl -L -O https://fossil.kd2.org/paheko-plugins/uv/helloasso.tar.gz
2023-02-18 21:03:59 +00:00
# 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
2023-02-18 21:09:06 +00:00
COPY config/nginx-paheko.conf /etc/nginx/http.d
2023-02-18 21:03:59 +00:00
# Configure PHP (seems useless)
# to have the function finfo_open (uncomment ;extension=fileinfo)
#COPY config/php.ini /etc/php81/php.ini
# Configure PHP-FPM
2023-02-18 21:09:06 +00:00
COPY config/fpm-paheko.conf /etc/php81/php-fpm.d/
2023-02-18 21:03:59 +00:00
# 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
2023-02-18 21:09:06 +00:00
RUN chown -R nobody: /run /var/lib/nginx /var/log/nginx /var/www/paheko
2023-02-18 21:03:59 +00:00
# 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