File size: 536 Bytes
ee46c3b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM python:3.11.11-bookworm

# Set working directory
WORKDIR /app

# Copy only requirements first to leverage Docker layer caching
COPY requirements.txt /app/


# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code
COPY . /app

# Switch to a non-root user (optional)
# RUN useradd -m appuser && chown -R appuser /app
# USER appuser

# Default command (optional, replace "app.py" with your app's entry point)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]