Skip to content

Commit

Permalink
feat: Docker Image
Browse files Browse the repository at this point in the history
  • Loading branch information
zzsza committed Feb 10, 2024
1 parent 554d006 commit ec13c80
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions 02-online-serving(fastapi)/projects/web_single/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
FROM python:3.9.13-slim as requirements-stage

WORKDIR /tmp
RUN pip install poetry
COPY ./pyproject.toml ./poetry.lock* /tmp/
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes

FROM python:3.9.13-slim

WORKDIR /code
COPY --from=requirements-stage /tmp/requirements.txt /code/requirements.txt
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY . /code
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]

0 comments on commit ec13c80

Please sign in to comment.