diff --git a/gateway/Dockerfile.gateway b/gateway/Dockerfile.gateway index 992aaad..431bfba 100644 --- a/gateway/Dockerfile.gateway +++ b/gateway/Dockerfile.gateway @@ -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 \ No newline at end of file +# Run the application +CMD ["./run.sh"] \ No newline at end of file diff --git a/gateway/run.sh b/gateway/run.sh index 0663eea..fe6570a 100755 --- a/gateway/run.sh +++ b/gateway/run.sh @@ -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 \ No newline at end of file