Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +7 -22
Dockerfile
CHANGED
@@ -1,34 +1,19 @@
|
|
1 |
# Use an official Python runtime as a parent image
|
2 |
FROM python:3.11-slim
|
3 |
|
4 |
-
# Set
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
#
|
8 |
-
|
9 |
-
ENV TRANSFORMERS_CACHE=/data/hf_cache/transformers
|
10 |
-
ENV HF_DATASETS_CACHE=/data/hf_cache/datasets
|
11 |
-
ENV HF_HUB_CACHE=/data/hf_cache/hub
|
12 |
-
|
13 |
-
# Create cache directories and give permissions
|
14 |
-
RUN mkdir -p /data/hf_cache/transformers /data/hf_cache/datasets /data/hf_cache/hub \
|
15 |
-
&& chmod -R 777 /data/hf_cache
|
16 |
|
17 |
-
#
|
18 |
-
RUN
|
19 |
|
20 |
-
#
|
21 |
-
COPY requirements.txt .
|
22 |
RUN pip install --no-cache-dir -r requirements.txt
|
23 |
|
24 |
-
#
|
25 |
-
COPY . .
|
26 |
-
|
27 |
-
# If you have a .streamlit/config.toml, copy it explicitly
|
28 |
-
# This prevents the PermissionError when Streamlit tries to write defaults
|
29 |
-
COPY .streamlit/config.toml /app/.streamlit/
|
30 |
-
|
31 |
-
# Expose the port Streamlit runs on
|
32 |
EXPOSE 8501
|
33 |
|
34 |
# Run Streamlit
|
|
|
1 |
# Use an official Python runtime as a parent image
|
2 |
FROM python:3.11-slim
|
3 |
|
4 |
+
# Set working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Copy everything first (including .streamlit)
|
8 |
+
COPY . .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
# Fix permissions (make sure /app is writable)
|
11 |
+
RUN chmod -R 777 /app
|
12 |
|
13 |
+
# Install dependencies
|
|
|
14 |
RUN pip install --no-cache-dir -r requirements.txt
|
15 |
|
16 |
+
# Expose port
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
EXPOSE 8501
|
18 |
|
19 |
# Run Streamlit
|