euler314 commited on
Commit
b54b02c
·
verified ·
1 Parent(s): 901fb75

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -30
Dockerfile CHANGED
@@ -1,37 +1,21 @@
1
- # Use Python 3.9 slim (runs as root by default)
2
- FROM python:3.9-slim-bookworm
3
 
4
- # --- Environment ---
5
  ENV PYTHONDONTWRITEBYTECODE=1 \
6
- PYTHONUNBUFFERED=1 \
7
- STREAMLIT_HOME=/tmp/.streamlit \
8
- HOME=/tmp
9
 
10
- # Create Streamlit config dir (root-owned, writable by root)
11
- RUN mkdir -p $STREAMLIT_HOME
12
-
13
- # --- System deps for conversions ---
14
- RUN apt-get update && \
15
- DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
16
- pandoc \
17
- unoconv \
18
- libreoffice-core \
19
- ffmpeg \
20
- libmagic1 && \
21
- rm -rf /var/lib/apt/lists/*
22
 
23
- # --- Python deps ---
24
- RUN pip install --no-cache-dir \
25
- streamlit==1.45.1 \
26
- pillow \
27
- pypandoc \
28
- ffmpeg-python \
29
- python-magic
30
 
31
- # --- App code ---
32
- COPY app.py /app/app.py
33
- WORKDIR /app
34
 
35
- # --- Expose & launch ---
36
  EXPOSE 7860
37
- CMD ["streamlit", "run", "app.py"]
 
 
 
1
+ # Dockerfile
2
+ FROM python:3.10-slim
3
 
4
+ # Prevent Python from writing .pyc files to disk and buffer stdout/stderr
5
  ENV PYTHONDONTWRITEBYTECODE=1 \
6
+ PYTHONUNBUFFERED=1
 
 
7
 
8
+ WORKDIR /app
 
 
 
 
 
 
 
 
 
 
 
9
 
10
+ # Install dependencies
11
+ RUN pip install --upgrade pip
12
+ RUN pip install gradio
 
 
 
 
13
 
14
+ # Copy your app code
15
+ COPY app.py .
 
16
 
17
+ # Expose Gradio’s default port
18
  EXPOSE 7860
19
+
20
+ # Launch the app
21
+ CMD ["python", "app.py"]