vitalune commited on
Commit
49a3165
·
verified ·
1 Parent(s): 9face12

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -38
Dockerfile CHANGED
@@ -1,52 +1,20 @@
1
- FROM python:3.12-slim
2
 
3
- # Set working directory
4
  WORKDIR /app
5
 
6
- # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
8
  build-essential \
9
  curl \
 
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- # Create user and home directory structure
13
- RUN useradd -m -u 1000 user && \
14
- mkdir -p /home/user/.streamlit && \
15
- chown -R user:user /home/user
16
-
17
- # Upgrade pip
18
- RUN pip install --no-cache-dir --upgrade pip
19
-
20
- # Copy and install requirements (as root for global install)
21
  COPY requirements.txt ./
22
- RUN pip install --no-cache-dir -r requirements.txt
23
-
24
- # Create app directories
25
- RUN mkdir -p /app/.streamlit /app/data /app/storage && \
26
- chown -R user:user /app
27
-
28
- # Copy Streamlit config to both locations
29
- COPY .streamlit/config.toml /app/.streamlit/config.toml
30
- COPY .streamlit/config.toml /home/user/.streamlit/config.toml
31
-
32
- # Copy application code
33
  COPY src/ ./src/
34
 
35
- # Set final permissions
36
- RUN chown -R user:user /app /home/user
37
-
38
- # Switch to user
39
- USER user
40
 
41
- # Set environment variables
42
- ENV HOME=/home/user \
43
- PATH=/home/user/.local/bin:$PATH \
44
- PYTHONUNBUFFERED=1 \
45
- STREAMLIT_SERVER_PORT=7860 \
46
- STREAMLIT_SERVER_ADDRESS=0.0.0.0
47
 
48
- # Expose port
49
- EXPOSE 7860
50
 
51
- # Run Streamlit
52
- CMD ["streamlit", "run", "src/streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]
 
1
+ FROM python:3.12.5-slim
2
 
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  curl \
8
+ git \
9
  && rm -rf /var/lib/apt/lists/*
10
 
 
 
 
 
 
 
 
 
 
11
  COPY requirements.txt ./
 
 
 
 
 
 
 
 
 
 
 
12
  COPY src/ ./src/
13
 
14
+ RUN pip3 install -r requirements.txt
 
 
 
 
15
 
16
+ EXPOSE 8501
 
 
 
 
 
17
 
18
+ HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
 
19
 
20
+ ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]