Created
November 17, 2022 12:51
-
-
Save smirnoffs/aaff4756e69fed2009f0d829e2072160 to your computer and use it in GitHub Desktop.
Start AIOhttp web-server with external docker dependency and stop the container on SIGINT (ctrl+c)
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 | |
| trap_ctrlc() { | |
| echo "Stopping container" | |
| cont_id=$(docker ps -q --filter name=my-container) | |
| docker stop $cont_id | |
| echo "Container stopped" | |
| } | |
| trap trap_ctrlc INT | |
| if ! [[ $(docker ps -q --filter name=my-container) ]]; then | |
| docker run -d -p 6000:5000 my-container | |
| fi | |
| .venv/bin/gunicorn main:get_async_wep_app_for_gunicorn \ | |
| --workers 2 \ | |
| --timeout 60 \ | |
| --reload \ | |
| --worker-class aiohttp.GunicornWebWorker --bind localhost:5000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment