Skip to content

Commit

Permalink
Run the app using a helper script
Browse files Browse the repository at this point in the history
All so that uvicorn will use and print the same port that we specified
with SDXLC_PORT when running `docker compose up`.
  • Loading branch information
sajith committed Jun 18, 2024
1 parent 58412e8 commit d8a5169
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@ ENV VIRTUAL_ENV="/opt/venv"

RUN pip3 install --no-cache-dir .[wsgi]

EXPOSE 8080

ENTRYPOINT ["python3"]
CMD ["-m", "uvicorn", "sdx_lc.app:asgi_app", "--host", "0.0.0.0", "--port", "8080"]
CMD ["./entrypoint.sh"]
10 changes: 10 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/sh

# A helper script that can be executed off docker, just so that
# uvicorn will print the right port number. Docker will not do
# environment variable substitution in CMD lines, so this script
# became necessary.

set -eu

python3 -m uvicorn sdx_lc.app:asgi_app --host 0.0.0.0 --port "$SDXLC_PORT"

0 comments on commit d8a5169

Please sign in to comment.