This repository has been archived on 2020-08-21. You can view files and clone it, but cannot push or open issues or pull requests.
5 changed files with
91 additions and
0 deletions
|
|
|
@ -0,0 +1 @@
|
|
|
|
|
onyx2/log/*.log
|
|
|
|
@ -0,0 +1,5 @@
|
|
|
|
|
# onyx2 files
|
|
|
|
|
onyx2/cache/*.cache.php
|
|
|
|
|
onyx2/config/root.xml
|
|
|
|
|
onyx2/log/php.log
|
|
|
|
|
onyx2/log/*.log
|
|
|
|
@ -0,0 +1,34 @@
|
|
|
|
|
# DOCKER-VERSION 1.3.2
|
|
|
|
|
|
|
|
|
|
FROM debian:wheezy
|
|
|
|
|
MAINTAINER Pierre-Olivier Mercier <nemunaire@nemunai.re>
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
@ -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 <<EOF > ${BASEDIR}/onyx/db/docker.profile.php &&
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
if(!defined('ONYX')) exit;
|
|
|
|
|
|
|
|
|
|
\$___profile['db'] = '$DB_ENV_MYSQL_DATABASE';
|
|
|
|
|
\$___profile['host'] = '$DB_PORT_3306_TCP_ADDR';
|
|
|
|
|
\$___profile['user'] = '$DB_ENV_MYSQL_USER';
|
|
|
|
|
\$___profile['pass'] = '$DB_ENV_MYSQL_PASSWORD';
|
|
|
|
|
EOF
|
|
|
|
|
sed -i 's/"profile">sample</"profile">docker</' ${BASEDIR}/onyx/config/root.xml
|
|
|
|
|
|
|
|
|
|
# Continue execution
|
|
|
|
|
exec "$@"
|
|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|
}
|