jsantangelo commited on
Commit
03a6894
·
verified ·
1 Parent(s): 433860d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -8
Dockerfile CHANGED
@@ -1,15 +1,27 @@
1
- FROM python:3.9
2
 
3
- WORKDIR /code
4
 
5
- COPY ./requirements.txt /code/requirements.txt
 
 
 
 
6
 
7
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
8
 
9
- COPY . .
 
 
10
 
11
- EXPOSE 7860
 
12
 
13
- ENV GRADIO_SERVER_NAME="0.0.0.0"
 
14
 
15
- CMD ["python", "app.py"]
 
 
 
1
+ FROM python:3.11-slim
2
 
3
+ WORKDIR /app
4
 
5
+ ENV PYTHONUNBUFFERED=1 \
6
+ PORT=7860 \
7
+ STREAMLIT_SERVER_HEADLESS=true \
8
+ STREAMLIT_BROWSER_GATHERUSAGESTATS=false \
9
+ STREAMLIT_CONFIG_DIR=/app/.streamlit
10
 
11
+ # minimal OS deps + tini for clean PID 1
12
+ RUN apt-get update && apt-get install -y --no-install-recommends \
13
+ ca-certificates curl tini && rm -rf /var/lib/apt/lists/*
14
 
15
+ # Python deps
16
+ COPY requirements.txt .
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
 
19
+ # App code
20
+ COPY . .
21
 
22
+ # avoid permission errors for Streamlit internal files
23
+ RUN mkdir -p /app/.streamlit && chmod -R 777 /app/.streamlit
24
 
25
+ EXPOSE 7860
26
+ ENTRYPOINT ["/usr/bin/tini", "--"]
27
+ CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0", "--server.port=7860"]