Spaces:
Runtime error
Runtime error
acecalisto3
commited on
Update DOCKERFILE
Browse files- DOCKERFILE +23 -14
DOCKERFILE
CHANGED
@@ -1,24 +1,33 @@
|
|
1 |
-
# Use
|
2 |
-
FROM python:3.
|
3 |
|
4 |
-
# Set
|
|
|
|
|
|
|
|
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
#
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
#
|
11 |
-
|
12 |
|
13 |
-
#
|
14 |
-
RUN pip install
|
15 |
-
RUN
|
16 |
|
17 |
-
# Copy the application code into the
|
18 |
COPY . .
|
19 |
|
20 |
-
# Expose the port
|
21 |
-
EXPOSE
|
22 |
|
23 |
-
#
|
24 |
CMD ["python", "app.py"]
|
|
|
1 |
+
# Use an official Python runtime as the base image
|
2 |
+
FROM python:3.10-slim
|
3 |
|
4 |
+
# Set environment variables
|
5 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
6 |
+
ENV PYTHONUNBUFFERED=1
|
7 |
+
|
8 |
+
# Set the working directory in the container
|
9 |
WORKDIR /app
|
10 |
|
11 |
+
# Install system dependencies
|
12 |
+
RUN apt-get update && apt-get install -y \
|
13 |
+
build-essential \
|
14 |
+
libssl-dev \
|
15 |
+
libffi-dev \
|
16 |
+
python3-dev \
|
17 |
+
&& rm -rf /var/lib/apt/lists/*
|
18 |
|
19 |
+
# Copy the requirements file into the container
|
20 |
+
COPY requirements.txt .
|
21 |
|
22 |
+
# Upgrade pip and install Python dependencies
|
23 |
+
RUN pip install --upgrade pip
|
24 |
+
RUN pip install -r requirements.txt
|
25 |
|
26 |
+
# Copy the rest of the application code into the container
|
27 |
COPY . .
|
28 |
|
29 |
+
# Expose the port your app runs on (adjust if necessary)
|
30 |
+
EXPOSE 7860
|
31 |
|
32 |
+
# Define the command to run the application
|
33 |
CMD ["python", "app.py"]
|