Containerize

This commit is contained in:
R. Miles McCain
2020-04-14 10:55:01 -04:00
parent 783ba5aced
commit db6dee5d69
6 changed files with 61 additions and 3 deletions

5
shynet/celeryworker.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
# Start queue worker processes
echo Launching Shynet queue worker...
exec celery -A shynet worker -E --loglevel=INFO --concurrency=3

View File

@@ -54,6 +54,7 @@ INSTALLED_APPS = [
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
@@ -124,6 +125,9 @@ USE_TZ = True
# https://docs.djangoproject.com/en/2.2/howto/static-files/
STATIC_URL = "/static/"
STATIC_ROOT = "compiledstatic/"
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
# Auth
@@ -150,8 +154,7 @@ SITE_ID = 1
# Celery
if DEBUG:
CELERY_TASK_ALWAYS_EAGER = True
CELERY_TASK_ALWAYS_EAGER = True
CELERY_BROKER_URL = os.getenv("CELERY_BROKER_URL")
CELERY_REDIS_SOCKET_TIMEOUT = 15

8
shynet/webserver.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
# Start Gunicorn processes
echo Launching Shynet web server...
exec gunicorn shynet.wsgi:application \
--bind 0.0.0.0:8080 \
--workers 3 \
--timeout 100