-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (17 loc) · 797 Bytes
/
Dockerfile
File metadata and controls
26 lines (17 loc) · 797 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
25
FROM python:3.10-slim
# Set an environment variable to ensure Python outputs are sent straight to terminal without being first buffered
ENV PYTHONUNBUFFERED 1
# Set the working directory in the container
WORKDIR /src
# Create a virtual environment to isolate our package dependencies locally
RUN python -m venv venv
ENV PATH="/src/venv/bin:$PATH"
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Copy the current directory contents into the container at /src
COPY requirements.txt src/ /src/
# Install any needed packages specified in requirements.txt
RUN pip install --upgrade pip && pip install -r requirements.txt
EXPOSE 8000
ENTRYPOINT ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]