Now deployable

This commit is contained in:
Paul Mathieu 2023-07-03 19:56:32 +02:00
parent 2395bc215d
commit 0d164a1f31
2 changed files with 9 additions and 5 deletions

View File

@ -1,7 +1,7 @@
FROM alpine
RUN apk --no-cache add python3 inkscape bash imagemagick ttf-opensans
RUN apk --no-cache add py3-pip && pip3 install django tzdata
RUN apk --no-cache add py3-pip && pip3 install django tzdata gunicorn
ADD backend /root/zetikettes
@ -11,5 +11,5 @@ RUN mkdir -p /usr/share/fonts/TTF \
# the script will look for templates in /data
WORKDIR /root/zetikettes
CMD /usr/bin/python3 zetikettes/manage.py runserver 0.0.0.0:8000
WORKDIR /root/zetikettes/zetikettes
CMD /usr/bin/gunicorn zetikettes.wsgi -b 0.0.0.0:8000 --timeout 600

View File

@ -18,7 +18,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
#TIKETTE_OUT_DIR = BASE_DIR / 'data'
TIKETTE_OUT_DIR = Path('/data')
MEDIA_ROOT = TIKETTE_OUT_DIR
MEDIA_URL = 'data/'
MEDIA_URL = '/data/'
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
@ -29,7 +29,9 @@ SECRET_KEY = 'django-insecure-64qxpe55#9wy=5@#dl0)3w7ywxh48m!f&!slp9e7v4lh@hjdct
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['aerith.ponteilla.net']
CSRF_TRUSTED_ORIGINS = ['https://aerith.ponteilla.net']
# Application definition
@ -122,6 +124,8 @@ USE_TZ = True
STATIC_URL = 'static/'
STATIC_ROOT = 'www_static'
# Default primary key field type
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field