mirror of
https://0xacab.org/jvoisin/mat2-web.git
synced 2025-02-23 16:49:59 -05:00
use tmpfs for file storage
This commit is contained in:
parent
40d4fdad9e
commit
e53ea9a051
@ -30,14 +30,13 @@ RUN set -x \
|
||||
&& cp ./config/nginx.conf /etc/nginx/nginx.conf \
|
||||
&& cp ./config/uwsgi.config /etc/uwsgi/apps-enabled/mat2-web.ini \
|
||||
&& chown 101:101 /etc/uwsgi/apps-enabled/mat2-web.ini \
|
||||
&& mkdir -p /var/cache/nginx \
|
||||
&& mkdir -p /var/cache/nginx \
|
||||
&& chown -R 101:0 /var/cache/nginx \
|
||||
&& chmod -R g+w /var/cache/nginx \
|
||||
&& ln -sf /dev/stdout /var/log/nginx/access.log \
|
||||
&& ln -sf /dev/stderr /var/log/nginx/error.log \
|
||||
&& rm -rf /var/cache/apt/* /var/lib/apt/lists/* \
|
||||
&& mkdir ./uploads \
|
||||
&& chown -R nginx:nginx .
|
||||
&& chown -R nginx:nginx .
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
|
@ -202,6 +202,13 @@ and `Dockerfile.production` is used for production deployments.
|
||||
You can find the automated docker builds in the registry of this
|
||||
repository: https://0xacab.org/jvoisin/mat2-web/container_registry
|
||||
|
||||
### Building the production image
|
||||
Build command: `docker build -f Dockerfile.production -t mat-web .`
|
||||
|
||||
Run it: ` docker run -ti -p8181:8080 --read-only --tmpfs /tmp --tmpfs=/var/www/mat2-web/uploads mat-web:latest`
|
||||
|
||||
This does mount the upload folder as tmpfs and servers the app on `localhost:8181`
|
||||
|
||||
# Configuration
|
||||
|
||||
The default settings from `main.py` may be overridden by adding a `config.py`
|
||||
|
@ -9,6 +9,6 @@ server {
|
||||
location / { try_files $uri @yourapplication; }
|
||||
location @yourapplication {
|
||||
include uwsgi_params;
|
||||
uwsgi_pass unix:/var/www/mat2-web/mat2-web.sock;
|
||||
uwsgi_pass unix:/tmp/uwsgi.sock;
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ gid = www-data
|
||||
harakiri = 30
|
||||
die-on-term = true
|
||||
|
||||
socket = mat2-web.sock
|
||||
socket = /tmp/uwsgi.sock
|
||||
chmod-socket = 774
|
||||
plugins = python3
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user