Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +28 -0
Dockerfile
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official Python runtime as a parent image.
|
2 |
+
# We choose a slim version to keep the image size small.
|
3 |
+
FROM python:3.10-slim
|
4 |
+
|
5 |
+
# Set the working directory in the container.
|
6 |
+
# All subsequent commands will be executed in this directory.
|
7 |
+
WORKDIR /app
|
8 |
+
|
9 |
+
# Copy the requirements file into the container.
|
10 |
+
# We do this first to leverage Docker's layer caching.
|
11 |
+
# If requirements.txt doesn't change, this step is skipped.
|
12 |
+
COPY requirements.txt ./
|
13 |
+
|
14 |
+
# Install any needed packages specified in requirements.txt.
|
15 |
+
# The --no-cache-dir flag helps to keep the image smaller.
|
16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
+
|
18 |
+
# Copy the rest of the application code into the working directory.
|
19 |
+
COPY . .
|
20 |
+
|
21 |
+
# Expose a port if your application is a web server.
|
22 |
+
# For example, if your application runs on port 8000.
|
23 |
+
# EXPOSE 8000
|
24 |
+
|
25 |
+
# Define the command to run your application.
|
26 |
+
# This command will be executed when the container starts.
|
27 |
+
# We use main.py as the entry point, as per our architecture.
|
28 |
+
CMD ["python", "main.py"]
|