add nginad

This commit is contained in:
kev 2015-09-18 17:05:05 +08:00
parent 119c5fcfb2
commit 46ba1c9c12
4 changed files with 83 additions and 0 deletions

40
nginad/Dockerfile Normal file
View File

@ -0,0 +1,40 @@
#
# Dockerfile for nginad
#
FROM alpine
MAINTAINER kev <noreply@datageek.info>
WORKDIR /var/www/html
RUN apk add -U ca-certificates \
git \
gzip \
nginx \
php-fpm \
php-json \
php-openssl \
php-pdo \
php-phar \
php-xml \
php-zlib \
tar \
&& wget -O- https://github.com/nginadfoundation/nginad/archive/1.6.5.tar.gz | tar xz --strip 1 \
&& cd upload \
&& php composer.phar self-update \
&& php composer.phar install \
&& cd config/autoload \
&& cp database.local.php.dist database.local.php \
&& cp delivery.local.php.dist delivery.local.php \
&& cp email.local.php.dist email.local.php \
&& cp rtb.config.local.php.dist rtb.config.local.php \
&& sed -i -e "s/'pass' => ''/'pass' => 'root'/" \
-e "s/'host' => 'localhost'/'host' => 'mysql'/" database.local.php \
&& chown -R nobody:nobody . \
&& rm -rf /var/cache/apk/*
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD php-fpm && nginx -g 'daemon off;'

2
nginad/README.md Normal file
View File

@ -0,0 +1,2 @@
nginad
======

14
nginad/docker-compose.yml Normal file
View File

@ -0,0 +1,14 @@
nginad:
image: vimagick/nginad
ports:
- "8080:80"
links:
- mysql
restart: always
mysql:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=nginad
restart: always

27
nginad/nginx.conf Normal file
View File

@ -0,0 +1,27 @@
worker_processes 4;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name _;
root /var/www/html/upload/public/;
index index.php;
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param REDIRECT_STATUS 200;
fastcgi_pass 127.0.0.1:9000;
}
}
}