File size: 835 Bytes
99fdb5f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM python:3.10-slim

# Prevent Python buffering & writing bytecode
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

WORKDIR /app

# 1. Install all Linux tools needed by your converters
RUN apt-get update && apt-get install -y --no-install-recommends \
    ffmpeg \
    libreoffice \
    pandoc \
    potrace \
    imagemagick \
    p7zip-full \
    unzip \
    libcairo2 \
    libheif-dev \
    && rm -rf /var/lib/apt/lists/*

# 2. Copy requirements & install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# 3. Copy project files
COPY . .

# 4. Create working folders with full permissions
RUN mkdir -p static/output tmp temp && chmod -R 777 static tmp temp

# 5. Port 7860 for Hugging Face Spaces
EXPOSE 7860

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]