File size: 430 Bytes
699a338
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Stage 1: Build the Python environment and install dependencies
FROM python:3.11-slim-bullseye AS builder

WORKDIR /app

# Copy only the requirements file first to leverage Docker layer caching
COPY requirements.txt .
COPY setup.py .
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt

COPY . .

# Clean up after install (if necessary)
RUN rm -rf /root/.cache

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