File size: 738 Bytes
c0e5df5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.10-slim

# Install basic system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \

    build-essential \
    && rm -rf /var/lib/apt/clean/var/lib/apt/lists/*

# Set up user permissions using Debian standard useradd
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app

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

# Copy server code
COPY --chown=user . .

# Hugging Face Spaces routes traffic natively through port 7860
EXPOSE 7860
ENV PORT=7860

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