omm7 commited on
Commit
091f15a
·
verified ·
1 Parent(s): dd1b4db

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -11
Dockerfile CHANGED
@@ -1,20 +1,35 @@
1
- FROM python:3.13.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"]
 
 
 
 
 
1
+ FROM python:3.10-slim
 
 
2
 
3
+ # System dependencies
4
  RUN apt-get update && apt-get install -y \
 
 
5
  git \
6
+ ffmpeg \
7
+ libsm6 \
8
+ libxext6 \
9
+ libgl1 \
10
+ libglib2.0-0 \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Create user (HuggingFace requires non-root)
14
+ RUN useradd -m -u 1000 user
15
+ USER user
16
+ ENV HOME=/home/user \
17
+ PATH=/home/user/.local/bin:$PATH
18
+
19
+ WORKDIR /home/user/app
20
 
21
+ # Install Python deps
22
+ COPY --chown=user requirements.txt .
23
+ RUN pip install --no-cache-dir --upgrade pip && \
24
+ pip install --no-cache-dir -r requirements.txt
25
 
26
+ # Copy app files
27
+ COPY --chown=user . .
28
 
29
+ EXPOSE 7860
30
 
31
+ CMD ["streamlit", "run", "app/app.py", \
32
+ "--server.port=7860", \
33
+ "--server.address=0.0.0.0", \
34
+ "--server.headless=true", \
35
+ "--server.fileWatcherType=none"]