Change h5ai config, patch, volume share and nginx conf

This commit is contained in:
Jean Froment 2017-03-09 18:22:31 +01:00
parent 3eff1c7f7c
commit c23226a922
5 changed files with 30 additions and 29 deletions

View File

@ -1,33 +1,20 @@
FROM ubuntu:14.04 FROM ubuntu:trusty
MAINTAINER Jean Froment <froment.je@gmail.com> MAINTAINER Jean Froment <froment.je@gmail.com>
ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get install -y nginx php5-fpm supervisor wget unzip patch
ENV H5AI_VERSION 0.29.0
ENV HTTPD_USER www-data
RUN apt-get update && apt-get install -y \ # download latest release
nginx php5-fpm supervisor \ RUN wget http:`(wget https://larsjung.de/h5ai/ -q -O -) | sed 's/.*href="\(.*\.zip\)".*/\1/p' | head -n1`
wget unzip patch acl \ RUN unzip h5ai-*.zip -d /usr/share/h5ai
libav-tools imagemagick \
graphicsmagick zip unzip php5-gd
# install h5ai and patch configuration ADD h5ai.nginx.conf /etc/nginx/sites-available/default
RUN wget http://release.larsjung.de/h5ai/h5ai-$H5AI_VERSION.zip
RUN unzip h5ai-$H5AI_VERSION.zip -d /usr/share/h5ai
# patch h5ai because we want to deploy it ouside of the document root and use /var/www as root for browsing VOLUME /torrents
COPY class-setup.php.patch class-setup.php.patch
RUN patch -p1 -u -d /usr/share/h5ai/_h5ai/private/php/core/ -i /class-setup.php.patch && rm class-setup.php.patch
RUN rm /etc/nginx/sites-enabled/default ADD h5ai-path.patch patch
RUN patch -p1 -u -d /usr/share/h5ai/_h5ai/private/php/core/ -i /patch && rm patch
#make the cache writable ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN chown ${HTTPD_USER} /usr/share/h5ai/_h5ai/public/cache/
RUN chown ${HTTPD_USER} /usr/share/h5ai/_h5ai/private/cache/
# use supervisor to monitor all services
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD supervisord -c /etc/supervisor/conf.d/supervisord.conf CMD supervisord -c /etc/supervisor/conf.d/supervisord.conf
# expose only nginx HTTP port
EXPOSE 80 EXPOSE 80

View File

@ -1,11 +1,13 @@
diff --git a/class-setup.php b/class-setup.php
index 8743dee..663c069 100644
--- a/class-setup.php --- a/class-setup.php
+++ b/class-setup.php +++ b/class-setup.php
@@ -97,7 +97,7 @@ class Setup { @@ -106,7 +106,7 @@ class Setup {
$this->set('H5AI_PATH', Util::normalize_path(dirname(dirname(dirname(dirname(__FILE__)))), false)); $this->set('H5AI_PATH', Util::normalize_path(dirname(dirname(dirname(dirname(__FILE__)))), false));
$this->set('ROOT_HREF', Util::normalize_path(dirname($this->get('H5AI_HREF')), true)); $this->set('ROOT_HREF', Util::normalize_path(dirname($this->get('H5AI_HREF')), true));
- $this->set('ROOT_PATH', Util::normalize_path(dirname($this->get('H5AI_PATH')), false)); - $this->set('ROOT_PATH', Util::normalize_path(dirname($this->get('H5AI_PATH')), false));
+ $this->set('ROOT_PATH', "/var/www"); + $this->set('ROOT_PATH', '/torrents');
$this->set('PUBLIC_HREF', Util::normalize_path($this->get('H5AI_HREF') . '/public/', true)); $this->set('PUBLIC_HREF', Util::normalize_path($this->get('H5AI_HREF') . '/public/', true));
$this->set('PUBLIC_PATH', Util::normalize_path($this->get('H5AI_PATH') . '/public/', false)); $this->set('PUBLIC_PATH', Util::normalize_path($this->get('H5AI_PATH') . '/public/', false));

View File

@ -0,0 +1,13 @@
server {
listen 80;
root /var/www;
index /_h5ai/public/index.php;
try_files $uri $uri/ =404;
location /_h5ai/ {
root /usr/share/h5ai/;
location /_h5ai/public/index.php {
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
}
}
}

View File

@ -1,6 +1,5 @@
[supervisord] [supervisord]
nodaemon=true nodaemon=true
logfile=/var/log/supervisor/supervisord.log
[program:php5-fpm] [program:php5-fpm]
command=/usr/sbin/php5-fpm --nodaemonize command=/usr/sbin/php5-fpm --nodaemonize

View File

@ -64,7 +64,7 @@ services:
ports: ports:
- "12333:80" - "12333:80"
volumes: volumes:
- torrents:/var/www - torrents:/torrents
- config:/config - config:/config
env_file: env_file:
- config - config