Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +31 -0
Dockerfile
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use the official Python image as the base image
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Set environment variables
|
5 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
6 |
+
ENV PYTHONUNBUFFERED=1
|
7 |
+
|
8 |
+
# Set the working directory
|
9 |
+
WORKDIR /app
|
10 |
+
|
11 |
+
# Copy the application code into the container
|
12 |
+
COPY . /app
|
13 |
+
|
14 |
+
# Install system dependencies
|
15 |
+
RUN apt-get update && apt-get install -y \
|
16 |
+
gcc \
|
17 |
+
python3-dev \
|
18 |
+
libjpeg-dev \
|
19 |
+
zlib1g-dev \
|
20 |
+
&& apt-get clean \
|
21 |
+
&& rm -rf /var/lib/apt/lists/*
|
22 |
+
|
23 |
+
# Install Python dependencies
|
24 |
+
RUN pip install --no-cache-dir --upgrade pip
|
25 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
26 |
+
|
27 |
+
# Expose the port the app runs on
|
28 |
+
EXPOSE 5700
|
29 |
+
|
30 |
+
# Define the command to run the application
|
31 |
+
CMD ["python", "app.py"]
|