-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (17 loc) · 713 Bytes
/
Dockerfile
File metadata and controls
24 lines (17 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# py image from docker hub
FROM python:3.11-slim
# Set the working directory in the container
WORKDIR /app
# 1st copy only poerty file - to leverage docker caching mechanism
COPY pyproject.toml poetry.lock /app/
# install poetry
RUN pip install poetry
# install dependencies using poetry
# convey poetry not have its env in docker container
RUN poetry config virtualenvs.create false && poetry install --only main --no-interaction --no-ansi
# copy current directory content to container at /app /// "." means current directory // copy src dest
COPY . /app/
# expose port 8000
EXPOSE 8000
# command to run the appltn using uvicorn
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0" , "--port", "8000"]