make listener port in Dockerfile configurable

This commit is contained in:
ducklet 2023-03-17 23:17:28 +01:00
parent 9fb24741a1
commit c2a9cfecf1
2 changed files with 12 additions and 2 deletions

View file

@ -19,7 +19,10 @@ USER 10000:10001
COPY . ./ COPY . ./
ENV UNWIND_DATA="/data" ENV UNWIND_DATA="/data"
VOLUME ["/data"] VOLUME $UNWIND_DATA
ENV UNWIND_PORT=8097
EXPOSE $UNWIND_PORT
ENTRYPOINT ["/var/app/run"] ENTRYPOINT ["/var/app/run"]
CMD ["server"] CMD ["server"]

View file

@ -1,7 +1,14 @@
#!/bin/sh -eu #!/bin/sh -eu
: "${UNWIND_PORT:=8097}"
cd "$RUN_DIR" cd "$RUN_DIR"
[ -z "${DEBUG:-}" ] || set -x [ -z "${DEBUG:-}" ] || set -x
exec uvicorn --host 0.0.0.0 --factory unwind:create_app export UNWIND_PORT
exec uvicorn \
--host 0.0.0.0 \
--port "$UNWIND_PORT" \
--factory unwind:create_app