File size: 445 Bytes
f092a9b
 
 
 
79f5a9b
 
 
 
 
f092a9b
 
79f5a9b
 
 
a30d178
79f5a9b
a30d178
79f5a9b
a30d178
f092a9b
 
 
a30d178
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.9-slim

WORKDIR /app

# Install dependencies first to leverage cache
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY . /app

# Create a non-root user and switch to it
RUN useradd -m -u 1000 user

# Set ownership
RUN chown -R user:user /app

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

EXPOSE 7860

CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]