Spaces:
Runtime error
Runtime error
Commit
·
c0aa976
1
Parent(s):
d172d27
issue resolved
Browse files- Dockerfile +17 -14
Dockerfile
CHANGED
@@ -1,26 +1,29 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
# Set working directory
|
4 |
WORKDIR /app
|
5 |
|
6 |
-
# Install
|
7 |
-
RUN apt-get update &&
|
8 |
-
libgl1-mesa-glx \
|
9 |
-
|
10 |
-
portaudio19-dev \
|
11 |
-
ffmpeg \
|
12 |
-
&& apt-get clean
|
13 |
|
14 |
-
#
|
15 |
COPY Web_app/requirements.txt ./requirements.txt
|
16 |
RUN pip install --upgrade pip
|
17 |
RUN pip install --no-cache-dir -r requirements.txt
|
18 |
|
19 |
-
# Copy
|
20 |
-
COPY Web_app
|
21 |
|
22 |
-
# Expose the
|
23 |
-
EXPOSE
|
24 |
|
25 |
-
#
|
26 |
CMD ["python", "app.py"]
|
|
|
1 |
+
# Use official Python image
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Set environment variables to avoid permission issues
|
5 |
+
ENV MPLCONFIGDIR=/tmp
|
6 |
+
ENV YOLO_CONFIG_DIR=/tmp
|
7 |
+
ENV OPENAI_API_KEY=your_openai_key_here
|
8 |
|
9 |
# Set working directory
|
10 |
WORKDIR /app
|
11 |
|
12 |
+
# Install system dependencies
|
13 |
+
RUN apt-get update && \
|
14 |
+
apt-get install -y libgl1-mesa-glx portaudio19-dev ffmpeg && \
|
15 |
+
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
16 |
|
17 |
+
# Copy requirements and install dependencies
|
18 |
COPY Web_app/requirements.txt ./requirements.txt
|
19 |
RUN pip install --upgrade pip
|
20 |
RUN pip install --no-cache-dir -r requirements.txt
|
21 |
|
22 |
+
# Copy your app code
|
23 |
+
COPY Web_app /app/
|
24 |
|
25 |
+
# Expose the Flask port
|
26 |
+
EXPOSE 7860
|
27 |
|
28 |
+
# Run the app
|
29 |
CMD ["python", "app.py"]
|