-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (18 loc) · 834 Bytes
/
Dockerfile
File metadata and controls
25 lines (18 loc) · 834 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
# Use an official Python runtime as a parent image
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
# Run app.py when the container launches
ENTRYPOINT ["python", "main.py"]