File size: 657 Bytes
2f87aed
 
9b23f6f
 
 
 
 
6996a7f
57d51b7
 
 
 
 
 
b03779c
2f87aed
 
57d51b7
bc75bbb
2f87aed
 
 
8c5af8c
2f87aed
 
 
 
8c5af8c
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
FROM python:3.10-slim

# Install wget and git for HF Space requirements
RUN apt-get update && apt-get install -y \
    wget \
    git \
    && rm -rf /var/lib/apt/lists/*

# Create a user with home directory for git config
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR /app

# Copy and install requirements
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY --chown=user main.py .

EXPOSE 7860

# Start the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]