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/themes/
etc/ghost/content/logs/*.log.* etc/ghost/content/logs/*.log.*
etc/ghost/content/data/ghost\.db

View File

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

View File

@@ -40,23 +40,23 @@ server {
ssl_certificate_key /etc/letsencrypt/live/openrsc.com/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/openrsc.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/openrsc.com/chain.pem; ssl_trusted_certificate /etc/letsencrypt/live/openrsc.com/chain.pem;
root /app; root /var/www/html/;
index index.jsp index.html index.htm;
index index.php index.html index.htm index.jsp;
client_max_body_size 100M; client_max_body_size 100M;
location / {
root /var/www/html;
}
####### Proxies ####### ####### Proxies #######
# # PHP proxy # PHP proxy
# location /board { location ~ \.php$ {
# fastcgi_pass php:9001; try_files $uri =404;
# fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(/.+)$;
# include fastcgi.conf; fastcgi_pass php:9000;
# root /app; 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 # Ghost proxy
location /blog { location /blog {
@@ -75,4 +75,38 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://tomcat; 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; error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log; access_log /var/log/nginx/access.log;
root /app; root /var/www/html/;
index index.jsp index.html index.htm;
index index.php index.html index.htm index.jsp;
client_max_body_size 100M; client_max_body_size 100M;
location / {
root /var/www/html;
}
####### Proxies ####### ####### Proxies #######
# # PHP proxy # PHP proxy
# location /board { location ~ \.php$ {
# fastcgi_pass php:9001; try_files $uri =404;
# fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(/.+)$;
# include fastcgi.conf; fastcgi_pass php:9000;
# root /app; 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 # Ghost proxy
location /blog { location /blog {
@@ -50,4 +50,38 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://tomcat; 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;
}
} }