File size: 640 Bytes
a0a0034
 
 
 
 
367edbd
 
 
 
 
a0a0034
 
 
771f178
 
 
 
 
a0a0034
 
 
 
 
 
 
f86b8ca
 
771f178
 
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
# Base image
FROM python:3.10

# Add user for HF Spaces
RUN useradd -m -u 1000 user

# Set working directory and change ownership
WORKDIR /app
RUN chown -R user:user /app

USER user
ENV PATH="/home/user/.local/bin:$PATH"

# Port config:
#   7860 = HuggingFace Spaces (default)
ENV PORT=7860
EXPOSE 7860

# Install dependencies
COPY --chown=user backend/requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt

# Copy all files
COPY --chown=user . /app

ENV PYTHONPATH=/app/backend

# Run FastAPI (serves frontend as static files too)
CMD uvicorn backend.main:app --host 0.0.0.0 --port $PORT