Spaces:
Configuration error
Configuration error
Update Dockerfile
Browse files- Dockerfile +8 -4
Dockerfile
CHANGED
|
@@ -1,14 +1,18 @@
|
|
| 1 |
-
FROM python:3.11
|
| 2 |
|
| 3 |
WORKDIR /code
|
| 4 |
|
|
|
|
| 5 |
COPY ./requirements.txt /code/requirements.txt
|
| 6 |
RUN python3 -m pip install --no-cache-dir --upgrade pip
|
| 7 |
RUN python3 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 8 |
|
|
|
|
| 9 |
COPY . .
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
|
| 3 |
WORKDIR /code
|
| 4 |
|
| 5 |
+
# Install dependencies
|
| 6 |
COPY ./requirements.txt /code/requirements.txt
|
| 7 |
RUN python3 -m pip install --no-cache-dir --upgrade pip
|
| 8 |
RUN python3 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 9 |
|
| 10 |
+
# Copy the app code
|
| 11 |
COPY . .
|
| 12 |
|
| 13 |
+
# Set permissions if needed (avoid root-level writes)
|
| 14 |
+
RUN mkdir -p /code/.cache && chmod -R 777 /code/.cache
|
| 15 |
+
ENV XDG_CACHE_HOME=/code/.cache
|
| 16 |
|
| 17 |
+
# Run the Panel server
|
| 18 |
+
CMD ["panel", "serve", "/code/app.py", "--address", "0.0.0.0", "--port", "7860", "--allow-websocket-origin", "*", "--index", "app"]
|