Spaces:
Sleeping
Sleeping
Abhishek Kumar
commited on
Commit
·
8ec847b
1
Parent(s):
371de80
Fix Streamlit permissions by moving config directory to /app/.streamlit
Browse files- Dockerfile +14 -14
Dockerfile
CHANGED
@@ -2,23 +2,23 @@ FROM python:3.9-slim
|
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
-
|
6 |
-
|
|
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
software-properties-common \
|
12 |
-
git \
|
13 |
-
&& rm -rf /var/lib/apt/lists/*
|
14 |
|
15 |
-
|
16 |
-
COPY
|
17 |
|
18 |
-
|
|
|
|
|
|
|
19 |
|
20 |
EXPOSE 8501
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
+
# Create directories and set permissions
|
6 |
+
RUN mkdir -p /app/.streamlit && \
|
7 |
+
chmod 777 /app/.streamlit
|
8 |
|
9 |
+
# Copy requirements first for better caching
|
10 |
+
COPY requirements.txt .
|
11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
12 |
|
13 |
+
# Copy the rest of the application
|
14 |
+
COPY . .
|
15 |
|
16 |
+
# Set environment variables
|
17 |
+
ENV STREAMLIT_SERVER_PORT=8501
|
18 |
+
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
19 |
+
ENV STREAMLIT_CONFIG_DIR=/app/.streamlit
|
20 |
|
21 |
EXPOSE 8501
|
22 |
|
23 |
+
# Run Streamlit
|
24 |
+
CMD ["streamlit", "run", "src/streamlit_app.py"]
|
|