File size: 510 Bytes
04151c2
 
ca02259
01c6383
ca02259
04151c2
01c6383
04151c2
 
 
01c6383
04151c2
 
ca02259
 
04151c2
 
01c6383
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Stage 1: Build
FROM python:3.9-slim as builder

WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt

# Stage 2: Final Image
FROM python:3.9-slim
WORKDIR /app

# Copy only the necessary files from the builder stage
COPY --from=builder /root/.local /root/.local
COPY . .

# Ensure scripts in .local are usable
ENV PATH=/root/.local/bin:$PATH

# Expose port 7860 (default port for Gradio)
EXPOSE 7860

# Run the app when the container launches
CMD ["python", "app.py"]