diff --git a/nginx_locations b/nginx_locations new file mode 100644 index 0000000..5c8f7e5 --- /dev/null +++ b/nginx_locations @@ -0,0 +1,18 @@ +# prod site +location /zetikettes { + alias /var/lib/zetikettes/frontend; +} +location /zetikettes/srv/static { + alias /var/lib/zetikettes/www_static; +} + +location ^~ /zetikettes/srv { + proxy_pass http://127.0.0.1:8000; + proxy_set_header SCRIPT_NAME /zetikettes/srv; + proxy_set_header Host $http_host; + + # generating stuff takes time + proxy_read_timeout 10m; + + client_max_body_size 10M; +} diff --git a/zetikettes.service b/zetikettes.service new file mode 100644 index 0000000..8e2736e --- /dev/null +++ b/zetikettes.service @@ -0,0 +1,16 @@ +[Unit] +Description=Zetikettes backend service +After=docker.service +Requires=docker.service + +[Service] +ExecStart=/usr/bin/docker run --rm --name %n \ + -p 127.0.0.1:8000:8000 \ + -v /var/lib/zetikettes/data:/data \ + zetikettes +Restart=on-failure +ExecStartPre=-/usr/bin/docker exec %n stop +ExecStartPre=-/usr/bin/docker rm %n + +[Install] +WantedBy=multi-user.target