euler314 commited on
Commit
e54c8f9
·
verified ·
1 Parent(s): 175f99d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -20
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Use Python 3.9 on Debian slim (runs as root by default)
2
  FROM python:3.9-slim-bookworm
3
 
4
  # --- Environment ---
@@ -7,33 +7,31 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
7
  STREAMLIT_HOME=/tmp/.streamlit \
8
  HOME=/tmp
9
 
10
- # Create Streamlit config directory (owned by root, writable by root)
11
  RUN mkdir -p $STREAMLIT_HOME
12
 
13
- # --- System dependencies for conversion libraries ---
14
  RUN apt-get update && \
15
  DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
16
- pandoc \ # for pypandoc conversions :contentReference[oaicite:2]{index=2}
17
- unoconv \ # headless LibreOffice converter :contentReference[oaicite:3]{index=3}
18
- libreoffice-core \ # LibreOffice engine for unoconv :contentReference[oaicite:4]{index=4}
19
- ffmpeg \ # audio/video processing :contentReference[oaicite:5]{index=5}
20
- libmagic1 \ # magic library for python-magic :contentReference[oaicite:6]{index=6}
21
- && rm -rf /var/lib/apt/lists/*
22
 
23
- # --- Python dependencies ---
24
  RUN pip install --no-cache-dir \
25
- streamlit==1.45.1 \ # Streamlit with event-loop fix :contentReference[oaicite:7]{index=7}
26
- pillow \ # image conversions :contentReference[oaicite:8]{index=8}
27
- pypandoc \ # text/markup conversions :contentReference[oaicite:9]{index=9}
28
- ffmpeg-python \ # wrapper for ffmpeg :contentReference[oaicite:10]{index=10}
29
- python-magic # MIME detection :contentReference[oaicite:11]{index=11}
30
 
31
- # --- Copy application code ---
32
  COPY app.py /app/app.py
33
  WORKDIR /app
34
 
35
- # --- Expose Streamlit port for Spaces (7860) ---
36
- EXPOSE 7860 # Hugging Face Spaces default :contentReference[oaicite:12]{index=12}
37
-
38
- # --- Launch the Streamlit app as root ---
39
  CMD ["streamlit", "run", "app.py"]
 
1
+ # Use Python 3.9 slim (runs as root by default)
2
  FROM python:3.9-slim-bookworm
3
 
4
  # --- Environment ---
 
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"]