diff options
| author | Jan Friedli | 2020-03-29 14:35:32 +0200 |
|---|---|---|
| committer | Jan Friedli | 2020-05-09 21:21:48 +0200 |
| commit | acb6694f8215ed09f83099196aa2165ba2c9dbd8 (patch) | |
| tree | 013aac524e535ad7c7342758c7968978e2baa1d7 | |
| parent | 465f1151d963dced746da0e7d6c3dc1a0bd5b8df (diff) | |
moved socket file and nginx pid to /tmpfs
| -rw-r--r-- | Dockerfile.production | 2 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | config/nginx-default.conf | 2 | ||||
| -rw-r--r-- | config/nginx.conf | 3 | ||||
| -rw-r--r-- | config/uwsgi.config | 2 |
5 files changed, 5 insertions, 6 deletions
diff --git a/Dockerfile.production b/Dockerfile.production index 025393f..8201361 100644 --- a/Dockerfile.production +++ b/Dockerfile.production | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | From registry.0xacab.org/georg/mat2-ci-images:debian | 3 | From registry.0xacab.org/georg/mat2-ci-images:debian |
| 4 | 4 | ||
| 5 | LABEL maintainer="Mat-Web Co-Maintainer <jan.friedli@immerda.ch>" | 5 | LABEL maintainer="Mat2-Web Co-Maintainer <jan.friedli@immerda.ch>" |
| 6 | 6 | ||
| 7 | WORKDIR /var/www/mat2-web | 7 | WORKDIR /var/www/mat2-web |
| 8 | 8 | ||
| @@ -205,7 +205,7 @@ repository: https://0xacab.org/jvoisin/mat2-web/container_registry | |||
| 205 | ### Building the production image | 205 | ### Building the production image |
| 206 | Build command: `docker build -f Dockerfile.production -t mat-web .` | 206 | Build command: `docker build -f Dockerfile.production -t mat-web .` |
| 207 | 207 | ||
| 208 | Run it: ` docker run -ti -p8181:8080 --security-opt=no-new-privileges --read-only --tmpfs /tmp --tmpfs=/var/www/mat2-web/uploads mat-web:latest` | 208 | Run it: `docker run -ti -p8181:8080 --security-opt=no-new-privileges --read-only --tmpfs=/tmp --tmpfs /tmpfs --tmpfs=/var/www/mat2-web/uploads mat-web:latest` |
| 209 | 209 | ||
| 210 | This does mount the upload folder as tmpfs and servers the app on `localhost:8181`. | 210 | This does mount the upload folder as tmpfs and servers the app on `localhost:8181`. |
| 211 | 211 | ||
diff --git a/config/nginx-default.conf b/config/nginx-default.conf index 52c2fe2..5abfe22 100644 --- a/config/nginx-default.conf +++ b/config/nginx-default.conf | |||
| @@ -9,6 +9,6 @@ server { | |||
| 9 | location / { try_files $uri @yourapplication; } | 9 | location / { try_files $uri @yourapplication; } |
| 10 | location @yourapplication { | 10 | location @yourapplication { |
| 11 | include uwsgi_params; | 11 | include uwsgi_params; |
| 12 | uwsgi_pass unix:/tmp/uwsgi.sock; | 12 | uwsgi_pass unix:/tmpfs/uwsgi.sock; |
| 13 | } | 13 | } |
| 14 | } | 14 | } |
diff --git a/config/nginx.conf b/config/nginx.conf index bd4770b..385f28f 100644 --- a/config/nginx.conf +++ b/config/nginx.conf | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | worker_processes auto; | 1 | worker_processes auto; |
| 2 | pid /tmp/nginx.pid; | 2 | pid /tmpfs/nginx.pid; |
| 3 | include /etc/nginx/modules-enabled/*.conf; | 3 | include /etc/nginx/modules-enabled/*.conf; |
| 4 | 4 | ||
| 5 | events { | 5 | events { |
| @@ -13,7 +13,6 @@ http { | |||
| 13 | # Basic Settings | 13 | # Basic Settings |
| 14 | ## | 14 | ## |
| 15 | 15 | ||
| 16 | sendfile on; | ||
| 17 | tcp_nopush on; | 16 | tcp_nopush on; |
| 18 | tcp_nodelay on; | 17 | tcp_nodelay on; |
| 19 | keepalive_timeout 65; | 18 | keepalive_timeout 65; |
diff --git a/config/uwsgi.config b/config/uwsgi.config index 56e0508..93441ed 100644 --- a/config/uwsgi.config +++ b/config/uwsgi.config | |||
| @@ -13,7 +13,7 @@ gid = 101 | |||
| 13 | harakiri = 30 | 13 | harakiri = 30 |
| 14 | die-on-term = true | 14 | die-on-term = true |
| 15 | 15 | ||
| 16 | socket = /tmp/uwsgi.sock | 16 | socket = /tmpfs/uwsgi.sock |
| 17 | chmod-socket = 774 | 17 | chmod-socket = 774 |
| 18 | plugins = python3 | 18 | plugins = python3 |
| 19 | 19 | ||
