Grocy docker patch (#78)

* typo corrections

* more typos

* initial work towards dockerized version of grocy

* placeholder for future README

* fully working dockerized grocy

* updated final size of docker images
This commit is contained in:
Talmai Oliveira
2018-09-30 03:31:16 -04:00
committed by Bernd Bestel
parent 83624eaf27
commit be326a5211
11 changed files with 242 additions and 2 deletions

28
docker_nginx/common.conf Normal file
View File

@@ -0,0 +1,28 @@
index index.php index.html index.htm;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~* .(jpg|jpeg|png|gif|ico|css|js)$ {
expires 365d;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
fastcgi_pass grocy:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}

View File

@@ -0,0 +1,8 @@
server {
listen 80 default_server;
server_name _;
root /www/public; # see: volumes_from
include /etc/nginx/common.conf;
}

View File

@@ -0,0 +1,20 @@
server {
listen 443 ssl;
server_name _;
root /www/public; # see: volumes_from
ssl_certificate /etc/nginx/certificates/cert.pem;
ssl_certificate_key /etc/nginx/certificates/key.pem;
error_log /var/log/nginx/error.log;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
include /etc/nginx/common.conf;
}

42
docker_nginx/nginx.conf Normal file
View File

@@ -0,0 +1,42 @@
user nobody;
worker_processes 1;
pid /var/run/nginx/nginx.pid;
error_log /var/log/nginx/error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
sendfile on;
#tcp_nopush on;
client_body_timeout 12;
client_header_timeout 12;
keepalive_timeout 15;
send_timeout 10;
client_body_buffer_size 10K;
client_header_buffer_size 1k;
client_max_body_size 50M;
large_client_header_buffers 2 1k;
gzip on;
gzip_comp_level 2;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/x-javascript text/xml text/css application/xml;
access_log on;
include /etc/nginx/conf.d/*.conf;
}