Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +27 -0
Dockerfile
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.12-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# Install system essentials
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
build-essential \
|
| 8 |
+
curl \
|
| 9 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
+
|
| 11 |
+
# Copy requirements first to leverage Docker caching
|
| 12 |
+
COPY requirements.txt .
|
| 13 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
+
|
| 15 |
+
# Copy the rest of the application
|
| 16 |
+
COPY . .
|
| 17 |
+
|
| 18 |
+
# Fix Windows line endings in the shell script and make it executable
|
| 19 |
+
RUN sed -i 's/\r$//' start.sh
|
| 20 |
+
RUN chmod +x start.sh
|
| 21 |
+
|
| 22 |
+
# Expose ports
|
| 23 |
+
EXPOSE 8000
|
| 24 |
+
EXPOSE 7860
|
| 25 |
+
|
| 26 |
+
# Use the shell form of CMD to ensure start.sh runs correctly
|
| 27 |
+
CMD ["/bin/bash", "./start.sh"]
|