-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yong Sheng Tan
committed
Feb 10, 2024
1 parent
29e76dd
commit c36a2b6
Showing
1 changed file
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
FROM python:3.9 | ||
|
||
WORKDIR / | ||
WORKDIR /code | ||
|
||
COPY requirements.txt ./ | ||
COPY requirements.txt /code/requirements.txt | ||
|
||
RUN pip install --no-cache-dir --upgrade -r ./requirements.txt | ||
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | ||
|
||
RUN useradd -m -u 1000 user | ||
|
||
USER user | ||
|
||
ENV HOME=/home/user \ | ||
PATH=/home/user/.local/bin:$PATH | ||
|
||
WORKDIR $HOME/app | ||
|
||
COPY --chown=user . $HOME/app | ||
|
||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |