File size: 1,009 Bytes
3060aa0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
29
# Use an official Python runtime as a parent image.
# We choose a slim version to keep the image size small.
FROM python:3.10-slim

# Set the working directory in the container.
# All subsequent commands will be executed in this directory.
WORKDIR /app

# Copy the requirements file into the container.
# We do this first to leverage Docker's layer caching.
# If requirements.txt doesn't change, this step is skipped.
COPY requirements.txt ./

# Install any needed packages specified in requirements.txt.
# The --no-cache-dir flag helps to keep the image smaller.
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code into the working directory.
COPY . .

# Expose a port if your application is a web server.
# For example, if your application runs on port 8000.
# EXPOSE 8000

# Define the command to run your application.
# This command will be executed when the container starts.
# We use main.py as the entry point, as per our architecture.
CMD ["python", "main.py"]