Created
February 15, 2020 11:33
-
-
Save kunthar/9439125a3f271ee5b17329585540759e to your computer and use it in GitHub Desktop.
Zarupa entrypoint.sh example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
. /zarupa-venv/bin/activate | |
#git clone https://github.com/kunthar/zarupa | |
pip install -r /zarupa/requirements.txt | |
pip install gunicorn | |
export FLASK_APP=/zarupa/zarupa/server.py | |
export FLASK_CONFIGURATION=production | |
export POSTGRES_USER=zarupa | |
export POSTGRES_PASSWORD= | |
export POSTGRES_HOST= | |
export POSTGRES_DB=zarupa | |
export REDIS_HOST= | |
ln -s /zarupa/zarupa /zarupa-venv/lib/python3.6/site-packages/zarupa | |
if [ $FIRST_RUN == 1 ]; then | |
cd /zarupa/zarupa | |
flask db upgrade | |
sleep 2 | |
flask db migrate | |
sleep 2 | |
python manage.py insert_data | |
#python fake_data.py all 10 | |
exit 0 | |
else | |
# GUNICORN_CMD_ARGS="--bind 0.0.0.0:5000 --keyfile /ssl/privkey.pem --certfile /ssl/cert.pem --workers=5 --log-level=debug --keep-alive=5" gunicorn zarupa.server:app | |
# GUNICORN_CMD_ARGS="--forwarded-allow-ips='192.168.121.110' --bind 0.0.0.0:5000 --keyfile /ssl/privkey.pem --certfile /ssl/cert.pem --ca-certs /ssl/chain.pem --workers=5 --log-level=debug --keep-alive=5" gunicorn zarupa.server:app | |
GUNICORN_CMD_ARGS="--bind 0.0.0.0:6500 --workers=5 --log-level=debug --keep-alive=5" gunicorn zarupa.server:app | |
# flask run --host 0.0.0.0 --port 5000 | |
fi | |
flask shell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment