ismdrobiul489 commited on
Commit
628b29b
·
1 Parent(s): fa5c7f4

Simplify Dockerfile for HF Spaces

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -29
Dockerfile CHANGED
@@ -1,41 +1,23 @@
1
- # NCAkit Docker Configuration for Hugging Face Spaces
2
- FROM python:3.11-slim
3
 
4
- # Install system dependencies
 
 
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  ffmpeg \
7
  libsndfile1 \
8
- git \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Create non-root user for HF Spaces
12
  RUN useradd -m -u 1000 user
13
  USER user
14
- ENV HOME=/home/user \
15
- PATH=/home/user/.local/bin:$PATH
16
-
17
- # Set working directory
18
- WORKDIR $HOME/app
19
-
20
- # Copy requirements first for caching
21
- COPY --chown=user requirements.txt .
22
- RUN pip install --no-cache-dir --user -r requirements.txt
23
-
24
- # Copy application code
25
- COPY --chown=user . .
26
 
27
- # Create data directories
28
- RUN mkdir -p $HOME/app/data $HOME/app/videos $HOME/app/temp
29
 
30
- # Environment for HF Spaces
31
- ENV DOCKER=true
32
- ENV PORT=8880
33
- ENV LOG_LEVEL=info
34
- ENV DATA_DIR=$HOME/app/data
35
- ENV VIDEOS_DIR=$HOME/app/videos
36
 
37
- # Expose REST API port
38
- EXPOSE 8880
39
 
40
- # Run the application
41
- CMD ["python", "app.py"]
 
1
+ # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
+ # NCAkit - Neural Content Automation Toolkit
3
 
4
+ FROM python:3.9
5
+
6
+ # Install system dependencies (ffmpeg for video processing)
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
8
  ffmpeg \
9
  libsndfile1 \
 
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
12
  RUN useradd -m -u 1000 user
13
  USER user
14
+ ENV PATH="/home/user/.local/bin:$PATH"
 
 
 
 
 
 
 
 
 
 
 
15
 
16
+ WORKDIR /app
 
17
 
18
+ COPY --chown=user ./requirements.txt requirements.txt
19
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
 
 
20
 
21
+ COPY --chown=user . /app
 
22
 
23
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8880"]