aboutsummaryrefslogtreecommitdiffstats
path: root/entrypoint.sh
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2022-03-22 00:39:40 +0800
committerJesús <heckyel@hyperbola.info>2022-03-22 00:39:40 +0800
commit3fca03988b42adaf8e67cc7137dd1fdba327e197 (patch)
treead39a5bc12a03c82b9a4fd980c1b92ca0a1dac93 /entrypoint.sh
downloadheroeapi-3fca03988b42adaf8e67cc7137dd1fdba327e197.tar.lz
heroeapi-3fca03988b42adaf8e67cc7137dd1fdba327e197.tar.xz
heroeapi-3fca03988b42adaf8e67cc7137dd1fdba327e197.zip
initial commit
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