openrat-cms

# OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

commit 31ab989c52f393d319953e75e00bb073e0e1630c
parent b5534583db972c6aa8355781b345db8f0ba9639d
Author: Jan Dankert <develop@jandankert.de>
Date:   Tue,  1 Oct 2019 00:18:35 +0200

New: Docker-Image is now based on Alpine Linux. Added the USER command for security reasons.

Diffstat:
.dockerignore | 2++
Dockerfile | 58+++++++++++++++++++++++++++++++++++++---------------------
README.md | 2+-
3 files changed, 40 insertions(+), 22 deletions(-)

diff --git a/.dockerignore b/.dockerignore @@ -0,0 +1 @@ +.git+ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile @@ -1,29 +1,45 @@ -#FROM php:7.0-apache -FROM debian:stretch-slim +FROM alpine:3.10 -# File Author / Maintainer -MAINTAINER dankert +LABEL maintainer="Jan Dankert" -RUN apt-get update \ - && apt-get install -y \ - apache2 \ - libapache2-mod-php7.0 \ - php-xml \ - php-mysql \ - && apt-get clean +ENV DOCROOT=/var/www/localhost/htdocs -# logs should go to stdout / stderr -RUN \ - ln -sfT /dev/stderr "/var/log/apache2/error.log" \ - && ln -sfT /dev/stdout "/var/log/apache2/access.log" +RUN apk --update --no-cache add \ + apache2 apache2-http2 \ + php7 php7-apache2 php7-session php7-pdo php7-pdo_mysql php7-pdo_pgsql php7-json php7-ftp php7-iconv php7-openssl && \ + sed -i '/LoadModule log_module/s/^/#/g' /etc/apache2/httpd.conf && \ + sed -i 's/^Listen 80/Listen 8080/g' /etc/apache2/httpd.conf && \ + chown apache /var/log/apache2 && \ + chown apache /run/apache2 && \ + rm -r $DOCROOT/* && \ + mkdir -p /var/www/preview && chown apache /var/www/preview && \ + echo "Alias /preview /var/www/preview" >> /etc/apache2/httpd.conf -# Remove default index.html -RUN rm -r /var/www/html/* -COPY . /var/www/html/ +COPY . $DOCROOT +COPY ./config/config-docker.yml /etc/openrat/config.yml +COPY ./config/config-etc.yml $DOCROOT/config/config.yml -EXPOSE 80 +# Cleanup +RUN rm -r $DOCROOT/doc/* && \ + find $DOCROOT/modules/cms-ui -type f -name "*.src.xml"|xargs rm -WORKDIR /var/www/html +EXPOSE 8080 -CMD apachectl -D FOREGROUND + +ENV DB_TYPE="mysql" +ENV DB_TYPE="mysql" +ENV DB_HOST="localhost" +ENV DB_NAME="cms" +ENV DB_USER="" +ENV DB_PASS="" + +ENV CMS_MOTD="Welcome to dockerized CMS" +ENV CMS_NAME="OpenRat CMS (Docker)" +ENV CMS_OPERATOR="Docker-Host" + +WORKDIR $DOCROOT + +USER apache + +CMD /usr/sbin/httpd -D FOREGROUND diff --git a/README.md b/README.md @@ -37,7 +37,7 @@ Download the complete archive and install it on your server #### Docker -OpenRat contains a Dockerfile. At the moment, you have to bake your own Docker Image. +OpenRat-CMS is available [at Dockerhub](https://hub.docker.com/r/openrat/openrat-cms). ## Configuration