From 179ae4546944359873668188c1f8479c70b89875 Mon Sep 17 00:00:00 2001 From: Nemunaire Date: Sun, 28 Dec 2014 11:41:07 +0100 Subject: [PATCH 1/3] Add gitignore --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2aa91d --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# onyx2 files +onyx2/cache/*.cache.php +onyx2/config/root.xml +onyx2/log/php.log +onyx2/log/*.log From a0954215f8b23ae4c3559c51e89d0bbcd0da85fe Mon Sep 17 00:00:00 2001 From: Nemunaire Date: Sun, 28 Dec 2014 11:42:02 +0100 Subject: [PATCH 2/3] Add nginx.conf --- nginx.conf | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..102dc55 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,28 @@ +server { + listen 80; + listen [::]:80 default_server ipv6only=on; + + access_log /var/log/nginx/pa4home.access.log; + error_log /var/log/nginx/pa4home.error.log debug; + + root /srv/www/pa4home/htdocs/; + + add_header X-Frame-Options DENY; + add_header Strict-Transport-Security max-age=31536000; + + index index.html; + + location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { + expires max; + add_header Pragma public; + add_header Cache-Control "public, must-revalidate, proxy-revalidate"; + } + + location ~ .*.php$ + { + try_files $uri =404; + fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_index index.php; + include fastcgi_params; + } +} From c3641d3f2746def425f8ab5a9a7b409072d1393c Mon Sep 17 00:00:00 2001 From: Nemunaire Date: Sun, 28 Dec 2014 11:53:28 +0100 Subject: [PATCH 3/3] Add Dockerfile --- .dockerignore | 1 + Dockerfile | 34 ++++++++++++++++++++++++++++++++++ entrypoint.sh | 23 +++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 entrypoint.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cb3b888 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +onyx2/log/*.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..834aaa6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +# DOCKER-VERSION 1.3.2 + +FROM debian:wheezy +MAINTAINER Pierre-Olivier Mercier + +# Install packages #################################################### + +RUN apt-get -y update && \ + apt-get install -y \ + nginx-light \ + php5-fpm \ + php5-gd \ + && \ + apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +WORKDIR /srv/www/pa4home + +EXPOSE 80 + +COPY entrypoint.sh /root/entrypoint.sh +ENTRYPOINT ["/root/entrypoint.sh"] + +RUN ln -sf /srv/www/pa4home/onyx/config/root.sample.xml /srv/www/pa4home/onyx/config/root.xml + +# Webserver configuration ############################################# + +COPY nginx.conf /etc/nginx/sites-available/default + +COPY htdocs /srv/www/pa4home/htdocs/ +COPY onyx2 /srv/www/pa4home/onyx2/ + +CMD service nginx start && \ + service php5-fpm start && \ + /bin/bash diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..459c753 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +BASEDIR=/srv/www/pa4home + +# Creating directory and set permissions +mkdir -p ${BASEDIR}/onyx/log +chown -R www-data:www-data ${BASEDIR}/onyx/log + +# Update database profile +cat < ${BASEDIR}/onyx/db/docker.profile.php && +sampledocker