docker-paheko/Dockerfile

104 lines
3.4 KiB
Text
Raw Normal View History

2023-02-18 21:03:59 +00:00
ARG ALPINE_VERSION=3.17
FROM alpine:${ALPINE_VERSION}
LABEL Maintainer="HluthWigg"
2023-02-18 21:09:06 +00:00
LABEL Description="Paheko on Alpine Linux with Docker"
2023-02-18 21:03:59 +00:00
# Setup document root
WORKDIR /var/www/
# Change the version here
2023-02-18 21:09:06 +00:00
ENV PAHEKO_VERSION 1.2.6
2023-02-18 21:03:59 +00:00
# Install packages and remove default server definition
RUN apk add --no-cache \
curl \
nginx \
php81 \
php81-ctype \
php81-curl \
php81-dom \
php81-fpm \
php81-gd \
php81-intl \
php81-mbstring \
#php81-mysqli \
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
# Downloading and installing Garradin
2023-02-18 21:09:06 +00:00
RUN curl -L -O https://fossil.kd2.org/garradin/uv/paheko-$PAHEKO_VERSION.tar.gz # download
RUN tar xzvf paheko-$PAHEKO_VERSION.tar.gz # extract
RUN mv paheko-$PAHEKO_VERSION /var/www/paheko # root of the website
RUN rm -r paheko-$PAHEKO_VERSION.tar.gz # cleaning
2023-02-18 21:03:59 +00:00
# Download and install plugins
2023-02-18 21:09:06 +00:00
RUN cd /var/www/paheko/data/plugins && \
2023-02-18 21:03:59 +00:00
curl -L -O https://fossil.kd2.org/garradin-plugins/uv/ouvertures.tar.gz ; \
curl -L -O https://fossil.kd2.org/garradin-plugins/uv/stock_velos.tar.gz ; \
curl -L -O https://fossil.kd2.org/garradin-plugins/uv/reservations.tar.gz ; \
curl -L -O https://fossil.kd2.org/garradin-plugins/uv/webstats.tar.gz ; \
curl -L -O https://fossil.kd2.org/garradin-plugins/uv/dompdf.tar.gz ; \
curl -L -O https://fossil.kd2.org/garradin-plugins/uv/git_documents.tar.gz ; \
curl -L -O https://fossil.kd2.org/garradin-plugins/uv/taima.tar.gz ; \
curl -L -O https://fossil.kd2.org/garradin-plugins/uv/caisse.tar.gz ;
#RUN curl -L -O https://fossil.kd2.org/garradin-plugins/uv/helloasso.tar.gz
#RUN curl -L -O https://fossil.kd2.org/garradin-plugins/uv/dompdf.tar.gz
#RUN curl -L -O https://fossil.kd2.org/garradin-plugins/uv/taima.tar.gz
2023-02-18 21:09:06 +00:00
#RUN mv helloasso.tar.gz /var/www/paheko/data/plugins/
#RUN mv *.tar.gz /var/www/paheko/data/plugins/
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
# Volume expose
VOLUME /var/www
## 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