Skip to content

Commit d2e68d7

Browse files
committed
Enable Uvicorn reloading for local development
whythawk-full-stack-fastapi-postgresql#1 tiangolo/uvicorn-gunicorn-docker#1 tiangolo/uvicorn-gunicorn-docker#6 PR #1 updated the backend Docker image from https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker to https://github.com/br3ndonland/inboard (see https://inboard.bws.bio). The previous Docker image had a start-reload.sh script, which started Uvicorn with reloading. With inboard, there's no need for a separate script. The same effect can be achieved with environment variables (`PROCESS_MANAGER=uvicorn`, `WITH_RELOAD=true`).
1 parent 11a8215 commit d2e68d7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend.dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ RUN bash -c "if [ $INSTALL_JUPYTER == 'true' ] ; then pip install jupyterlab ; f
1717

1818
ARG BACKEND_APP_MODULE=app.main:app
1919
ARG BACKEND_PRE_START_PATH=/app/prestart.sh
20-
ENV APP_MODULE=${BACKEND_APP_MODULE} PRE_START_PATH=${BACKEND_PRE_START_PATH}
20+
ARG BACKEND_PROCESS_MANAGER=gunicorn
21+
ARG BACKEND_WITH_RELOAD=false
22+
ENV APP_MODULE=${BACKEND_APP_MODULE} PRE_START_PATH=${BACKEND_PRE_START_PATH} PROCESS_MANAGER=${BACKEND_PROCESS_MANAGER} WITH_RELOAD=${BACKEND_WITH_RELOAD}
2123
COPY ./app/ /app/

0 commit comments

Comments
 (0)