signal handling

This commit is contained in:
Luca Beurer-Kellner
2025-03-11 15:08:05 +01:00
parent 5ec6d3403a
commit dc7d19d510
2 changed files with 7 additions and 3 deletions

View File

@@ -8,5 +8,7 @@ COPY . /srv/gateway
# Ensure run.sh is executable
RUN chmod +x /srv/gateway/run.sh
WORKDIR /srv/gateway
ENTRYPOINT ./run.sh
# Run the application
CMD ["./run.sh"]

View File

@@ -9,8 +9,10 @@ if [ $? -ne 0 ]; then
exit 1
fi
# using 'exec' belows ensures that signals like SIGTERM are passed to the child process
# and not the shell script itself (important when running in a container)
if [ "$DEV_MODE" = "true" ]; then
uvicorn serve:app --host 0.0.0.0 --port 8000 --reload
exec uvicorn serve:app --host 0.0.0.0 --port 8000 --reload
else
uvicorn serve:app --host 0.0.0.0 --port 8000
exec uvicorn serve:app --host 0.0.0.0 --port 8000
fi