File Dockerfile

Last commit: Tue Oct 13 00:30:04 2026 +0200	Jan Dankert	Switch to PHP8, some things will be broken :-O; Extra HTTP Port for API requests in OpenAPI-REST design.
1 FROM alpine:3.24 2 3 LABEL org.opencontainers.image.title="OpenRat CMS" 4 LABEL org.opencontainers.image.description="OpenRat Content Management System" 5 LABEL org.opencontainers.image.url="http://www.openrat.de" 6 LABEL org.opencontainers.image.source="http://code.weiherhei.de/openrat-cms/" 7 LABEL org.opencontainers.image.licenses="GPL-3.0-or-later" 8 LABEL org.opencontainers.image.authors="Jan Dankert" 9 10 # Install packages 11 RUN apk --update --no-cache add \ 12 apache2 curl \ 13 php85 php85-apache2 php85-session php85-pdo php85-pdo_mysql php85-pdo_pgsql php85-json php85-ftp php85-iconv php85-openssl php85-mbstring php85-dom php85-xml 14 15 ENV DB_TYPE="mysql" \ 16 DB_HOST="localhost" \ 17 DB_NAME="cms" \ 18 DB_USER="cms" \ 19 DB_PASS="" \ 20 CMS_MOTD="" \ 21 CMS_NAME="OpenRat CMS (Docker)" \ 22 CMS_OPERATOR="" \ 23 CMS_LOG_LEVEL="info" \ 24 CMS_PRODUCTION="true" \ 25 CMS_TIMEZONE="" \ 26 CMS_LANGUAGE="" \ 27 DOCROOT="/var/www/localhost/cms" 28 29 # Configuring apache webserver 30 # - disable access log 31 RUN sed -i '/CustomLog/s/^/#/g' /etc/apache2/httpd.conf && \ 32 sed -i '/LoadModule vhost_alias_module/s/^#//g' /etc/apache2/httpd.conf && \ 33 sed -i '/LoadModule rewrite_module/s/^#//g' /etc/apache2/httpd.conf && \ 34 sed -i 's/^Listen 80/Listen 8080\nListen 8090\nListen 8081\nListen 8082/g' /etc/apache2/httpd.conf && \ 35 sed -i -e 's/ServerSignature On/ServerSignature Off/' /etc/apache2/httpd.conf && \ 36 sed -i -e 's/expose_php = On/expose_php = Off/' /etc/php85/php.ini && \ 37 echo "Header set Server \"OpenRat CMS\"" >> /etc/apache2/httpd.conf && \ 38 chown apache /var/log/apache2 && \ 39 chown apache /run/apache2 && \ 40 mkdir $DOCROOT && \ 41 mkdir -p /var/www/localhost/public && \ 42 chown apache /var/www/localhost/public 43 44 COPY docker/apache.conf /etc/apache2/conf.d/openrat.conf 45 46 # Copy the application to document root 47 COPY . $DOCROOT 48 49 # Place configuration in /etc, outside the docroot. 50 RUN echo "include: /etc/openrat.yml" > $DOCROOT/config/config.yml 51 52 COPY docker/config.yml /etc/openrat.yml 53 54 RUN rm -rv $DOCROOT/docker 55 56 # Logfiles are redirected to standard out 57 RUN ln -sf /dev/stdout $DOCROOT/log/cms.log && \ 58 ln -sf /dev/stderr /var/log/apache2/error.log 59 60 EXPOSE 8080 61 EXPOSE 8081 62 EXPOSE 8082 63 EXPOSE 8090 64 65 WORKDIR $DOCROOT 66 67 USER apache 68 69 HEALTHCHECK --interval=10s --timeout=5m --retries=1 CMD curl -f http://localhost:8080/status/?upgrade || exit 1 70 CMD /usr/sbin/httpd -D FOREGROUND
Download Dockerfile
History Tue, 13 Oct 2026 00:30:04 +0200 Jan Dankert Switch to PHP8, some things will be broken :-O; Extra HTTP Port for API requests in OpenAPI-REST design. Thu, 24 Apr 2025 00:13:35 +0200 Jan Dankert New: OpenAPI with REST interface for all actions and methods Fri, 17 Feb 2023 21:04:55 +0100 Jan Dankert Docker-healthcheck should install/upgrade the database. Wed, 9 Mar 2022 01:57:45 +0100 dankert Fix: Do not write the language to a cookie. Thu, 18 Nov 2021 00:18:18 +0100 Jan Dankert Fix: Needing php-dom and php-xml for the template compiler (only for development) Sat, 6 Nov 2021 01:35:37 +0100 Jan Dankert New: Healthcheck for Docker container. Sat, 27 Feb 2021 20:12:04 +0100 Jan Dankert Enhanced Docker-Image with a separate port for generated content Thu, 19 Nov 2020 22:43:33 +0100 Jan Dankert New: Configure separate logging endpoints (file, syslog, stdout, stderr), so docker container may write directly to stdout. Thu, 19 Nov 2020 17:59:57 +0100 Jan Dankert New: Control log level with environment variables. Fri, 22 Nov 2019 23:05:44 +0100 Jan Dankert Redirecting logfiles in docker container to standard out and standard error. No logfile should be written in a container. Tue, 19 Nov 2019 20:39:45 +0100 Jan Dankert Fix permissions for preview folder; Added docker documentation. Tue, 19 Nov 2019 19:35:06 +0100 Jan Dankert Fix: Need for PHP multibyte string operation module Tue, 1 Oct 2019 22:25:24 +0200 Jan Dankert New: Enable HTTP/2 with h2c. Tue, 1 Oct 2019 22:19:02 +0200 Jan Dankert New: Enable Logfile in Docker image Tue, 1 Oct 2019 01:14:05 +0200 Jan Dankert Fix: Example configuration for Docker. Tue, 1 Oct 2019 00:31:57 +0200 Jan Dankert New: Install Git, HTTP/2 active Tue, 1 Oct 2019 00:18:35 +0200 Jan Dankert New: Docker-Image is now based on Alpine Linux. Added the USER command for security reasons. Fri, 25 May 2018 01:49:48 +0200 Jan Dankert Dockerfile auf Basis von Debian Stretch