File size: 642 Bytes
132c75c
 
511a8e5
 
132c75c
 
a17935c
132c75c
511a8e5
 
bd09639
 
 
132c75c
 
a17935c
 
 
6a06eb9
511a8e5
132c75c
a17935c
b2abbf3
511a8e5
a17935c
132c75c
a17935c
511a8e5
132c75c
4a1c06d
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
# Use Python slim image for efficiency
FROM python:3.10-slim

# Set up environment variables
ENV PYTHONUNBUFFERED=1 \
    PATH="/home/user/.local/bin:$PATH"

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Create non-root user
RUN useradd -m -u 1000 user
USER user
WORKDIR /app

# Install Python dependencies
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt

# Copy application files
COPY --chown=user . .

# Expose port
EXPOSE 7860

# Run application
CMD ["python", "app.py"]