File size: 738 Bytes
ea73290
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145b27b
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
# Use an official Python runtime as a parent image
FROM python:3.11-slim

# Create a non-root user with home directory
RUN useradd -m -u 1000 appuser
USER appuser

# Add local user bin directory to PATH
ENV PATH="/home/appuser/.local/bin:$PATH"

# Set working directory inside the container
WORKDIR /app

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

# Copy all the app files
COPY --chown=appuser:appuser . /app

# Expose the port that HF Spaces requires
EXPOSE 7860

# Command to run the app with uvicorn on port 7860, listening on all interfaces
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]