Skip to content

Commit 155d5db

Browse files
fix: module regression
- need pythonpath for modularized directories - fixes `ModuleNotFoundError: No module named 'app'`
1 parent ef2b1a6 commit 155d5db

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Dockerfile.web

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ ENV LANG C.UTF-8
4545
ENV LC_ALL C.UTF-8
4646
ENV PYTHONDONTWRITEBYTECODE 1
4747
ENV PYTHONFAULTHANDLER 1
48+
ENV PYTHONPATH=/app
4849

4950
# workers per core
5051
# https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker/blob/master/README.md#web_concurrency

app/startup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ else
99
export VENV="/opt/venv"
1010
fi
1111
export PATH="${VENV}/bin:$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH"
12+
export PYTHONPATH="${top_dir}"
1213

1314
server() {
1415
gunicorn \

0 commit comments

Comments
 (0)