Add Minimal Dockerfile
This commit is contained in:
24
docker/config.py
Normal file
24
docker/config.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""Sigl Docker Default Configuration.
|
||||
|
||||
Simple Grocery List (Sigl) | sigl.app
|
||||
Copyright (c) 2022 Asymworks, LLC. All Rights Reserved.
|
||||
"""
|
||||
|
||||
# Session and Token Keys
|
||||
APP_SESSION_KEY = 'sigl-docker-session-key'
|
||||
APP_TOKEN_KEY = 'sigl-docker-token-key'
|
||||
|
||||
# Database Settings
|
||||
DB_DRIVER = 'sqlite'
|
||||
DB_FILE = '/var/lib/sigl/sigl-test.db'
|
||||
|
||||
# Mail Configuration
|
||||
MAIL_ENABLED = False
|
||||
|
||||
# Logging Configuration
|
||||
LOGGING_DEST = 'wsgi'
|
||||
LOGGING_LEVEL = 'debug'
|
||||
LOGGING_FORMAT = '[%(asctime)s] [%(remote_addr)s - %(url)s] %(levelname)s in %(module)s: %(message)s'
|
||||
LOGGING_BACKTRACE = False
|
||||
SOCKETIO_LOGGING = True
|
||||
ENGINEIO_LOGGING = True
|
||||
25
docker/docker-entry.sh
Normal file
25
docker/docker-entry.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
export FLASK_APP=sigl.factory
|
||||
export FLASK_ENV=production
|
||||
export SIGL_CONFIG=${SIGL_CONFIG:-/home/sigl/config.py}
|
||||
export SIGL_PORT=${SIGL_PORT:-5151}
|
||||
|
||||
source venv/bin/activate
|
||||
|
||||
if [ "$1" = 'sigl' ]; then
|
||||
exec gunicorn -k eventlet -b :${SIGL_PORT} --access-logfile - --error-logfile - sigl.wsgi:app
|
||||
fi
|
||||
|
||||
if [ "$1" = 'db' ]; then
|
||||
if [ "$2" = 'downgrade' ]; then
|
||||
exec flask db downgrade
|
||||
else
|
||||
exec flask db upgrade
|
||||
fi
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user