File size: 1,184 Bytes
10f0e68
 
f92412e
10f0e68
 
 
f92412e
10f0e68
 
 
 
 
 
 
f92412e
10f0e68
 
 
 
f92412e
10f0e68
 
f92412e
10f0e68
 
f92412e
 
 
 
 
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
FROM python:3.11-slim

# Create a non-root user for security (required by Hugging Face)
RUN useradd -m -u 1000 user
USER user

# Set environment variables
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    PYTHONUNBUFFERED=1 \
    HF_HOME=/home/user/.cache/huggingface

WORKDIR /home/user/app

# Install dependencies first (better for caching)
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application
COPY --chown=user . .

# Hugging Face Spaces specific port
EXPOSE 7860

# ── CHANGE THIS LINE ──────────────────────────────────────────────────────────
# Instead of running uvicorn directly, we run main.py which starts 
# both the FastAPI server and the Telegram Bot.
CMD ["python", "main.py"]
# ──────────────────────────────────────────────────────────────────────────────