Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +11 -10
Dockerfile
CHANGED
|
@@ -1,23 +1,24 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
|
|
|
|
| 4 |
|
| 5 |
-
# Install
|
| 6 |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
-
# ✅ Create
|
| 9 |
-
RUN mkdir -p /
|
| 10 |
-
RUN mkdir -p /app/.files && chmod -R 777 /app/.files
|
| 11 |
|
| 12 |
-
# Copy requirements and install
|
| 13 |
COPY requirements.txt .
|
| 14 |
RUN pip install --upgrade pip && pip install -r requirements.txt
|
| 15 |
|
| 16 |
-
# Copy
|
| 17 |
COPY . .
|
| 18 |
|
| 19 |
-
# ✅ Set environment
|
| 20 |
-
ENV
|
|
|
|
| 21 |
|
| 22 |
-
#
|
| 23 |
CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Set working directory
|
| 4 |
+
WORKDIR /workspace
|
| 5 |
|
| 6 |
+
# Install system packages
|
| 7 |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
+
# ✅ Create writable directories for Chainlit
|
| 10 |
+
RUN mkdir -p /workspace/.files /workspace/.chainlit && chmod -R 777 /workspace
|
|
|
|
| 11 |
|
| 12 |
+
# Copy requirements and install dependencies
|
| 13 |
COPY requirements.txt .
|
| 14 |
RUN pip install --upgrade pip && pip install -r requirements.txt
|
| 15 |
|
| 16 |
+
# Copy app code
|
| 17 |
COPY . .
|
| 18 |
|
| 19 |
+
# ✅ Set environment variables to writable paths
|
| 20 |
+
ENV CHAINLIT_PROJECT_ROOT=/workspace
|
| 21 |
+
ENV CHAINLIT_STORAGE_DIR=/workspace/.chainlit
|
| 22 |
|
| 23 |
+
# ✅ Default CMD to run Chainlit app
|
| 24 |
CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]
|