From c25dafcea82cd0ddf12a270e4a44670a71e538fc Mon Sep 17 00:00:00 2001 From: Timon Engelke Date: Mon, 22 Jan 2024 12:24:38 +0100 Subject: [PATCH] Fix deployment issues --- README.md | 8 ++++---- bitpoll/settings_local.sample.py | 4 ++++ docker_files/uwsgi-bitpoll.ini | 5 ++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 965c3a6..fc89b99 100644 --- a/README.md +++ b/README.md @@ -19,16 +19,16 @@ Get the example settings file and adapt it according to your needs: ``` wget https://raw.githubusercontent.com/fsinfuhh/Bitpoll/master/bitpoll/settings_local.sample.py -O run/config/settings.py ``` +It is important to change at least the database settings, secret key, and allowed hosts. Start the docker container: ``` docker run -a stdout -a stderr --rm --name bitpoll -p 3008:3008 -p 3009:3009 --volume ./run/static:/opt/static --volume ./run/config:/opt/config ghcr.io/fsinfuhh/bitpoll ``` -The Static assets from `run/static` have to be served from the Webserver at `/static/`. -The Container listens for uwsgi traffic on Port 3008 and for HTTP traffic on Port 8009. - -TODO: add example nginx Config +The container is reachable on port 3009. +If you use an external web server, you can use uwsgi traffic on port 3008 and serve the static +assets from `run/static` at `/static/`. # Manual Install diff --git a/bitpoll/settings_local.sample.py b/bitpoll/settings_local.sample.py index 59d0932..cf85a35 100644 --- a/bitpoll/settings_local.sample.py +++ b/bitpoll/settings_local.sample.py @@ -1,5 +1,6 @@ # customize to your needs import re +import os # You must insert your own random value here # SECURITY WARNING: keep the secret key used in production secret! # see @@ -11,6 +12,9 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False +# The domain name of the site +ALLOWED_HOSTS = ['bitpoll.example.com'] + ## If Bitpoll is served via HTTPS enable the next two options #SESSION_COOKIE_SECURE = True #CSRF_COOKIE_SECURE = True diff --git a/docker_files/uwsgi-bitpoll.ini b/docker_files/uwsgi-bitpoll.ini index c80cf4d..a86a865 100644 --- a/docker_files/uwsgi-bitpoll.ini +++ b/docker_files/uwsgi-bitpoll.ini @@ -2,7 +2,7 @@ procname-master = uwsgi %n master = true socket = :3008 -http = :3009 +http-socket = :3009 plugins = python3 @@ -26,3 +26,6 @@ cheaper = 2 ; disable uWSGI request logging disable-logging = true + +; serve static files +static-map = /static=/opt/static