simplytaps commited on
Commit
feb5265
·
verified ·
1 Parent(s): bf00853

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -24
Dockerfile CHANGED
@@ -1,41 +1,25 @@
1
  # Dockerfile for Hugging Face Spaces Deployment
2
  # YouTube to Book Summary Converter
3
 
4
- # Use Python 3.10 slim as base image
5
  FROM python:3.10-slim
6
 
7
- # Set working directory (HF Spaces uses /app)
8
  WORKDIR /app
9
 
10
  # Set environment variables
11
- ENV PYTHONUNBUFFERED=1 \
12
- PYTHONDONTWRITEBYTECODE=1 \
13
- PIP_NO_CACHE_DIR=1 \
14
- PIP_DISABLE_PIP_VERSION_CHECK=1
15
-
16
- # Install system dependencies required for reportlab and python-docx
17
- RUN apt-get update && apt-get install -y --no-install-recommends \
18
- build-essential \
19
- && rm -rf /var/lib/apt/lists/* \
20
- && apt-get clean
21
-
22
- # Copy requirements first for better caching
23
- COPY requirements.txt .
24
 
25
- # Install Python dependencies
 
26
  RUN pip install --no-cache-dir -r requirements.txt
27
 
28
- # Copy application code
29
  COPY . .
30
 
31
- # Create non-root user for security (HF Spaces best practice)
32
- RUN useradd -m -u 1000 appuser && \
33
- chown -R appuser:appuser /app
34
- USER appuser
35
-
36
- # Hugging Face Spaces uses port 7860
37
  EXPOSE 7860
38
 
39
  # Run the Gradio app
40
- # HF Spaces requires binding to 0.0.0.0
41
  CMD ["python", "app.py", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # Dockerfile for Hugging Face Spaces Deployment
2
  # YouTube to Book Summary Converter
3
 
 
4
  FROM python:3.10-slim
5
 
 
6
  WORKDIR /app
7
 
8
  # Set environment variables
9
+ ENV PYTHONUNBUFFERED=1
10
+
11
+ # Install system dependencies
12
+ RUN apt-get update && apt-get install -y --no-install-recommends build-essential && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
 
13
 
14
+ # Copy requirements and install dependencies
15
+ COPY requirements.txt .
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
+ # Copy all application files
19
  COPY . .
20
 
21
+ # Expose port 7860 (Hugging Face Spaces default)
 
 
 
 
 
22
  EXPOSE 7860
23
 
24
  # Run the Gradio app
 
25
  CMD ["python", "app.py", "--host", "0.0.0.0", "--port", "7860"]