aboutsummaryrefslogtreecommitdiffstats
path: root/entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'entrypoint.sh')
-rw-r--r--entrypoint.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/entrypoint.sh b/entrypoint.sh
new file mode 100644
index 0000000..5a12698
--- /dev/null
+++ b/entrypoint.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env sh
+
+if [ ! -f "/srv/app/.env" ]; then
+ cat > /srv/app/.env <<- EOF
+API_DEBUG=${API_DBUG:-False}
+DB_NAME=${DB_NAME:-heroes}
+DB_HOST=${DB_HOST:-127.0.0.1}
+DB_PORT=${DB_PORT:-27017}
+DB_USER=${DB_USER:-root}
+DB_PASS=${DB_PASS:-example}
+DB_AUTH=${DB_AUTH:-admin}
+JWT_SECRET_KEY=${JWT_SECRET_KEY:-eo7aiHie4aeth4eteeho7ahC7yeetohsi7a}
+USER_ENABLE_REGISTER=${USER_ENABLE_REGISTER:-True}
+GUNICORN_TIMEOUT=${GUNICORN_TIMEOUT:-30}
+GUNICORN_NUM_WORKERS=${GUNICORN_NUM_WORKERS:-4}
+EOF
+fi
+
+cd /srv/app || exit
+
+exec gunicorn -b "0.0.0.0:5000" --timeout "${GUNICORN_TIMEOUT:-30}" --workers "${GUNICORN_NUM_WORKERS:-4}" wsgi:app