Nginx infrastructure
This commit is contained in:
+2
-1
@@ -1,4 +1,5 @@
|
||||
/apache_log
|
||||
/writable/logs/*
|
||||
/writable/cache/*
|
||||
/writable/session/*
|
||||
/writable/session/*
|
||||
/logs/*
|
||||
@@ -0,0 +1,13 @@
|
||||
FROM nginx
|
||||
COPY public /opt/mainsite/wrenchboard/www-api/public
|
||||
COPY spark /opt/mainsite/wrenchboard/www-api/spark
|
||||
COPY system /opt/mainsite/wrenchboard/www-api/system
|
||||
COPY composer.json /opt/mainsite/wrenchboard/www-api/composer.json
|
||||
COPY vendor /opt/mainsite/wrenchboard/www-api/vendor
|
||||
COPY app /opt/mainsite/wrenchboard/www-api/app
|
||||
COPY writable /opt/mainsite/wrenchboard/www-api/writable
|
||||
RUN chmod -R a+w /opt/mainsite/wrenchboard/www-api/writable
|
||||
COPY nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY nginx/fastcgi.conf /etc/nginx/fastcgi.conf
|
||||
COPY nginx/proxy.conf /etc/nginx/proxy.conf
|
||||
COPY nginx/mime.types /etc/nginx/mime.types
|
||||
Generated
+4154
File diff suppressed because it is too large
Load Diff
@@ -1,19 +1,23 @@
|
||||
version: '3'
|
||||
services:
|
||||
wrenchboard-api:
|
||||
image: registry.chiefsoft.net/wrenchboard-www-api:latest
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/apache/Dockerfile
|
||||
args:
|
||||
uid: ${UID}
|
||||
context: ./
|
||||
dockerfile: Dockerfile
|
||||
hostname: wrenchboard-www-api
|
||||
container_name: wrenchboard-www-api
|
||||
environment:
|
||||
- APACHE_RUN_USER=#${UID}
|
||||
- APACHE_RUN_GROUP=#${UID}
|
||||
- NGINX_HOST=wrenchboard-www-api
|
||||
- NGINX_PORT=80
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./:/var/www/html
|
||||
- ./apache_log:/var/log/apache2
|
||||
- ./:/usr/share/nginx/html
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./logs:/etc/nginx/logs
|
||||
ports:
|
||||
- 9083:80
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
volumes:
|
||||
src:
|
||||
@@ -0,0 +1,22 @@
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param QUERY_STRING $query_string;
|
||||
fastcgi_param REQUEST_METHOD $request_method;
|
||||
fastcgi_param CONTENT_TYPE $content_type;
|
||||
fastcgi_param CONTENT_LENGTH $content_length;
|
||||
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
fastcgi_param DOCUMENT_URI $document_uri;
|
||||
fastcgi_param DOCUMENT_ROOT $document_root;
|
||||
fastcgi_param SERVER_PROTOCOL $server_protocol;
|
||||
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
|
||||
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
|
||||
fastcgi_param REMOTE_ADDR $remote_addr;
|
||||
fastcgi_param REMOTE_PORT $remote_port;
|
||||
fastcgi_param SERVER_ADDR $server_addr;
|
||||
fastcgi_param SERVER_PORT $server_port;
|
||||
fastcgi_param SERVER_NAME $server_name;
|
||||
|
||||
fastcgi_index index.php;
|
||||
|
||||
fastcgi_param REDIRECT_STATUS 200;
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
types {
|
||||
text/html html htm shtml;
|
||||
text/css css;
|
||||
text/xml xml rss;
|
||||
image/gif gif;
|
||||
image/jpeg jpeg jpg;
|
||||
application/x-javascript js;
|
||||
text/plain txt;
|
||||
text/x-component htc;
|
||||
text/mathml mml;
|
||||
image/png png;
|
||||
image/x-icon ico;
|
||||
image/x-jng jng;
|
||||
image/vnd.wap.wbmp wbmp;
|
||||
application/java-archive jar war ear;
|
||||
application/mac-binhex40 hqx;
|
||||
application/pdf pdf;
|
||||
application/x-cocoa cco;
|
||||
application/x-java-archive-diff jardiff;
|
||||
application/x-java-jnlp-file jnlp;
|
||||
application/x-makeself run;
|
||||
application/x-perl pl pm;
|
||||
application/x-pilot prc pdb;
|
||||
application/x-rar-compressed rar;
|
||||
application/x-redhat-package-manager rpm;
|
||||
application/x-sea sea;
|
||||
application/x-shockwave-flash swf;
|
||||
application/x-stuffit sit;
|
||||
application/x-tcl tcl tk;
|
||||
application/x-x509-ca-cert der pem crt;
|
||||
application/x-xpinstall xpi;
|
||||
application/zip zip;
|
||||
application/octet-stream deb;
|
||||
application/octet-stream bin exe dll;
|
||||
application/octet-stream dmg;
|
||||
application/octet-stream eot;
|
||||
application/octet-stream iso img;
|
||||
application/octet-stream msi msp msm;
|
||||
audio/mpeg mp3;
|
||||
audio/x-realaudio ra;
|
||||
video/mpeg mpeg mpg;
|
||||
video/quicktime mov;
|
||||
video/x-flv flv;
|
||||
video/x-msvideo avi;
|
||||
video/x-ms-wmv wmv;
|
||||
video/x-ms-asf asx asf;
|
||||
video/x-mng mng;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
#daemon off;
|
||||
worker_processes 2;
|
||||
user www-data;
|
||||
|
||||
events {
|
||||
use epoll;
|
||||
worker_connections 128;
|
||||
}
|
||||
|
||||
error_log logs/error.log info;
|
||||
|
||||
http {
|
||||
server_tokens off;
|
||||
#include mime.types;
|
||||
include /etc/nginx/mime.types;
|
||||
include /etc/nginx/proxy.conf;
|
||||
include /etc/nginx/fastcgi.conf;
|
||||
charset utf-8;
|
||||
|
||||
access_log logs/access.log combined;
|
||||
|
||||
server {
|
||||
server_name wrenchboard-www-api;
|
||||
listen 80;
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
|
||||
root /opt/mainsite/wrenchboard/www-api/public;
|
||||
index index.php index.html;
|
||||
autoindex on;
|
||||
|
||||
# set expiration of assets to MAX for caching
|
||||
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
|
||||
expires max;
|
||||
log_not_found off;
|
||||
}
|
||||
|
||||
location / {
|
||||
# Check if a file or directory index file exists, else route it to index.php.
|
||||
try_files $uri $uri/ /index.php;
|
||||
|
||||
location = /index.php {
|
||||
fastcgi_pass host.docker.internal:9999;
|
||||
fastcgi_param SCRIPT_FILENAME /opt/mainsite/wrenchboard/www-api$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
return 444;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
client_max_body_size 10m;
|
||||
client_body_buffer_size 128k;
|
||||
proxy_connect_timeout 90;
|
||||
proxy_send_timeout 90;
|
||||
proxy_read_timeout 90;
|
||||
proxy_buffers 32 4k;
|
||||
Reference in New Issue
Block a user