Merge pull request #54 from Marwolf/master

PHP now functional, Docker enhancements
This commit is contained in:
Marwolf
2018-09-05 13:53:26 -04:00
committed by GitHub
4 changed files with 139 additions and 65 deletions

2
.gitignore vendored
View File

@@ -41,3 +41,5 @@ etc/ghost/content/data/\.DS_Store
etc/ghost/content/themes/
etc/ghost/content/logs/*.log.*
etc/ghost/content/data/ghost\.db

View File

@@ -2,13 +2,15 @@ version: '3.1'
services:
nginx:
image: nginx:latest
image: nginx:1.15.3-alpine-perl
container_name: nginx
volumes:
- "./etc/nginx:/etc/nginx/conf.d"
#- "./etc/nginx:/etc/nginx/conf.d"
- "./etc/nginx/default.conf:/etc/nginx/conf.d/default.conf"
- "./Website:/var/www/html"
- "./etc/nginx/logs:/var/log/nginx"
- "./etc/letsencrypt:/etc/letsencrypt"
#- "./etc/php:/etc/nginx/php"
ports:
- "80:80"
- "443:443"
@@ -19,17 +21,38 @@ services:
- tomcat
- mysqldb
myadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: phpmyadmin
ghost:
image: ghost:2.0.3-alpine
container_name: ghost
ports:
- "9000:80"
environment:
- PMA_ARBITRARY=1
- PMA_HOST=mysql
- "127.0.0.1:2368:2368"
restart: always
depends_on:
- mysqldb
env_file:
- ".env"
volumes:
- "./etc/ghost/content:/var/lib/ghost/content"
environment:
- url=${URL}
- privacy__useUpdateCheck=false
php:
image: nanoninja/php-fpm
container_name: php
ports:
- "127.0.0.1:9000:9000"
volumes:
- "./etc/php/php.ini:/usr/local/etc/php/conf.d/php.ini"
- "./Website:/var/www/html"
tomcat:
image: tomcat:latest
container_name: tomcat
ports:
- "127.0.0.1:8080:8080"
restart: always
volumes:
- "./Website:/usr/local/tomcat/webapps/ROOT"
- "./etc/tomcat:/usr/local/tomcat/conf"
mysqldb:
image: mariadb:latest
@@ -53,33 +76,14 @@ services:
- "./data/db/mysql:/var/lib/mysql"
- "./etc/mariadb/innodb.cnf:/etc/mysql/conf.d/innodb.cnf:ro"
tomcat:
image: tomcat:latest
container_name: tomcat
myadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: phpmyadmin
ports:
- "8080:8080"
restart: always
volumes:
- "./Website:/usr/local/tomcat/webapps/ROOT"
- "./etc/tomcat:/usr/local/tomcat/conf"
ghost:
image: ghost:latest
container_name: ghost
ports:
- "127.0.0.1:2368:2368"
restart: always
env_file:
- ".env"
volumes:
- "./etc/ghost/content:/var/lib/ghost/content"
- "55555:80"
environment:
- url=${URL}
- privacy__useUpdateCheck=false
php:
image: nanoninja/php-fpm:7.2
container_name: php
volumes:
- "./etc/php/php.ini:/usr/local/etc/php/conf.d/php.ini"
- "./Website:/var/www/html/public"
- PMA_ARBITRARY=1
- PMA_HOST=mysql
restart: always
depends_on:
- mysqldb

View File

@@ -40,23 +40,23 @@ server {
ssl_certificate_key /etc/letsencrypt/live/openrsc.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/openrsc.com/chain.pem;
root /app;
index index.jsp index.html index.htm;
root /var/www/html/;
index index.php index.html index.htm index.jsp;
client_max_body_size 100M;
location / {
root /var/www/html;
}
####### Proxies #######
# # PHP proxy
# location /board {
# fastcgi_pass php:9001;
# fastcgi_index index.php;
# include fastcgi.conf;
# root /app;
# }
# PHP proxy
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
# Ghost proxy
location /blog {
@@ -75,4 +75,38 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://tomcat;
}
####### PHPBB #######
# Deny access to internal phpbb files.
location ~ /board(config\.php|common\.php|files|images/avatars/upload|includes|(?<!ext/)phpbb|store|vendor) {
deny all;
# deny was ignored before 0.8.40 for connections over IPv6.
# Use internal directive to prohibit access on older versions.
internal;
}
# Correctly pass scripts for installer
location /install/ {
try_files $uri $uri/ @rewrite_installapp;
location ~ \.php(/|$) {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
location @rewrite_installapp {
rewrite ^(.*)$ /board/install/app.php/$1 last;
}
# Deny access to version control system directories.
location ~ /\.svn|/\.git {
deny all;
internal;
}
}

View File

@@ -15,23 +15,23 @@ server {
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /app;
index index.jsp index.html index.htm;
root /var/www/html/;
index index.php index.html index.htm index.jsp;
client_max_body_size 100M;
location / {
root /var/www/html;
}
####### Proxies #######
# # PHP proxy
# location /board {
# fastcgi_pass php:9001;
# fastcgi_index index.php;
# include fastcgi.conf;
# root /app;
# }
# PHP proxy
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
# Ghost proxy
location /blog {
@@ -50,4 +50,38 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://tomcat;
}
####### PHPBB #######
# Deny access to internal phpbb files.
location ~ /board(config\.php|common\.php|files|images/avatars/upload|includes|(?<!ext/)phpbb|store|vendor) {
deny all;
# deny was ignored before 0.8.40 for connections over IPv6.
# Use internal directive to prohibit access on older versions.
internal;
}
# Correctly pass scripts for installer
location /install/ {
try_files $uri $uri/ @rewrite_installapp;
location ~ \.php(/|$) {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
location @rewrite_installapp {
rewrite ^(.*)$ /board/install/app.php/$1 last;
}
# Deny access to version control system directories.
location ~ /\.svn|/\.git {
deny all;
internal;
}
}