File size: 538 Bytes
e43a9c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use a small Python image
FROM python:3.11-slim

# Create non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# Workdir inside the container
WORKDIR /app

# Install deps first for better layer caching
COPY --chown=user requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Copy the rest of your code
COPY --chown=user . /app

# Spaces expects your app to listen on port 7860
ENV PORT=7860
EXPOSE 7860

# Start the Dash app
CMD ["python", "app.py"]