File size: 732 Bytes
d93f479
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# -------- base image --------
FROM python:3.10-slim

ENV PYTHONUNBUFFERED=1 \
    OMP_NUM_THREADS=1 \
    TOKENIZERS_PARALLELISM=false 


# ---------- Create Non-Root User ----------
# Ensures proper file permissions for dev and runtime
RUN useradd -m -u 1000 user

# -------- install deps --------
WORKDIR /app

# ---------- Install Python Dependencies ----------
# Copy requirements and install as non-root user
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# ---------- Copy Project Files ----------
# Set appropriate ownership and permissions
COPY --link --chown=1000 . .

# Expose Gradio default port
EXPOSE 7860 7863

# Launch with unbuffered output
CMD ["python", "-m", "app.main"]