mgbam commited on
Commit
3e9544e
·
verified ·
1 Parent(s): 4cc7b5d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -30
Dockerfile CHANGED
@@ -1,40 +1,16 @@
1
- # Base image
2
  FROM python:3.10-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Install dependencies
8
- COPY requirements.txt .
9
- RUN pip install --upgrade pip && pip install -r requirements.txt
10
 
11
- # Copy app source code
12
  COPY . .
13
 
14
- # Make sure streamlit is executable
15
- RUN chmod +x /usr/local/bin/streamlit
16
 
17
- # Avoid writing to system root, Streamlit tries to save telemetry
18
- ENV STREAMLIT_HOME=/home/appuser
19
- ENV HOME=/home/appuser
20
- RUN mkdir -p $HOME/.streamlit
21
-
22
- # Write basic config to avoid permission error
23
- RUN echo "\
24
- [general]\n\
25
- email = \"\"\n\
26
- \n\
27
- [server]\n\
28
- headless = true\n\
29
- enableCORS = false\n\
30
- port = 8501\n\
31
- \n\
32
- [browser]\n\
33
- gatherUsageStats = false\n\
34
- " > $HOME/.streamlit/config.toml
35
-
36
- # Set default port
37
  EXPOSE 8501
38
 
39
- # Start Streamlit
40
- CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0", "--server.port=8501"]
 
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
4
 
5
+ COPY requirements.txt ./
6
+ RUN pip install --no-cache-dir -r requirements.txt
 
7
 
 
8
  COPY . .
9
 
10
+ # Fix permissions issue for /.streamlit
11
+ RUN mkdir -p /app/.streamlit && chmod -R 755 /app/.streamlit
12
 
13
+ # Expose port for Streamlit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  EXPOSE 8501
15
 
16
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]