Change h5ai config, patch, volume share and nginx conf
This commit is contained in:
parent
3eff1c7f7c
commit
c23226a922
|
@ -1,33 +1,20 @@
|
|||
FROM ubuntu:14.04
|
||||
FROM ubuntu:trusty
|
||||
MAINTAINER Jean Froment <froment.je@gmail.com>
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV H5AI_VERSION 0.29.0
|
||||
ENV HTTPD_USER www-data
|
||||
RUN apt-get update && apt-get install -y nginx php5-fpm supervisor wget unzip patch
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
nginx php5-fpm supervisor \
|
||||
wget unzip patch acl \
|
||||
libav-tools imagemagick \
|
||||
graphicsmagick zip unzip php5-gd
|
||||
# download latest release
|
||||
RUN wget http:`(wget https://larsjung.de/h5ai/ -q -O -) | sed 's/.*href="\(.*\.zip\)".*/\1/p' | head -n1`
|
||||
RUN unzip h5ai-*.zip -d /usr/share/h5ai
|
||||
|
||||
# install h5ai and patch configuration
|
||||
RUN wget http://release.larsjung.de/h5ai/h5ai-$H5AI_VERSION.zip
|
||||
RUN unzip h5ai-$H5AI_VERSION.zip -d /usr/share/h5ai
|
||||
ADD h5ai.nginx.conf /etc/nginx/sites-available/default
|
||||
|
||||
# patch h5ai because we want to deploy it ouside of the document root and use /var/www as root for browsing
|
||||
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
|
||||
VOLUME /torrents
|
||||
|
||||
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
|
||||
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
|
||||
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
CMD supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
# expose only nginx HTTP port
|
||||
EXPOSE 80
|
|
@ -1,11 +1,13 @@
|
|||
diff --git a/class-setup.php b/class-setup.php
|
||||
index 8743dee..663c069 100644
|
||||
--- a/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('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', "/var/www");
|
||||
+ $this->set('ROOT_PATH', '/torrents');
|
||||
|
||||
$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));
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
[supervisord]
|
||||
nodaemon=true
|
||||
logfile=/var/log/supervisor/supervisord.log
|
||||
|
||||
[program:php5-fpm]
|
||||
command=/usr/sbin/php5-fpm --nodaemonize
|
||||
|
|
|
@ -64,7 +64,7 @@ services:
|
|||
ports:
|
||||
- "12333:80"
|
||||
volumes:
|
||||
- torrents:/var/www
|
||||
- torrents:/torrents
|
||||
- config:/config
|
||||
env_file:
|
||||
- config
|
||||
|
|
Loading…
Reference in New Issue