Fix container signal handling
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m17s
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m17s
This commit is contained in:
@@ -40,4 +40,4 @@ ENV PYTHONUNBUFFERED=1
|
|||||||
ENV CONFIG_PATH=/app/config.ini
|
ENV CONFIG_PATH=/app/config.ini
|
||||||
|
|
||||||
# Run the bot using the entrypoint script
|
# Run the bot using the entrypoint script
|
||||||
ENTRYPOINT ["/app/entrypoint.sh"]
|
ENTRYPOINT ["/bin/sh", "/app/entrypoint.sh"]
|
@@ -1,4 +1,13 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Run the application in the background
|
# Run the application in the background
|
||||||
python generate_config.py && python pterodisbot.py
|
python generate_config.py && python pterodisbot.py &
|
||||||
|
|
||||||
|
# Capture the application's process ID
|
||||||
|
pid=$!
|
||||||
|
|
||||||
|
# Trap the SIGTERM signal and pass it through to the process upon stopping the container
|
||||||
|
trap "kill -TERM $pid" SIGTERM
|
||||||
|
|
||||||
|
# Wait for process to complete
|
||||||
|
wait $pid
|
Reference in New Issue
Block a user