Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +23 -17
Dockerfile
CHANGED
|
@@ -1,18 +1,24 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM python:3.10-slim
|
| 3 |
-
|
| 4 |
-
#
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
RUN
|
| 16 |
-
|
| 17 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
ENTRYPOINT ["./run.sh"]
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# --- START DNS FIX ---
|
| 5 |
+
# This line ensures the container uses Google's public DNS (8.8.8.8)
|
| 6 |
+
# for reliable hostname resolution, which should prevent the [Errno -5] error.
|
| 7 |
+
RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf
|
| 8 |
+
# --- END DNS FIX ---
|
| 9 |
+
|
| 10 |
+
# Set the working directory in the container
|
| 11 |
+
WORKDIR /app
|
| 12 |
+
|
| 13 |
+
# Copy the dependency file and install dependencies
|
| 14 |
+
COPY requirements.txt .
|
| 15 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
+
|
| 17 |
+
# Copy the rest of the application files (including vector_db and telegram_bot.py)
|
| 18 |
+
COPY . .
|
| 19 |
+
|
| 20 |
+
# Grant execution permissions to the run script
|
| 21 |
+
RUN chmod +x run.sh
|
| 22 |
+
|
| 23 |
+
# This tells the container what command to run when it starts
|
| 24 |
ENTRYPOINT ["./run.sh"]
|