-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (21 loc) · 817 Bytes
/
Dockerfile
File metadata and controls
28 lines (21 loc) · 817 Bytes
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
# Use Python 3.13-slim as the base image for a smaller footprint
FROM python:3.13-slim
# Set working directory
WORKDIR /app
# Install system dependencies
# build-essential is often needed for some python libraries
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy only the requirements first to leverage Docker cache
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the core library (src) and the web layer (backend)
COPY src/ ./src/
COPY backend/ ./backend/
# Expose the port (Cloud Run will inject $PORT)
ENV PORT 8080
# Command to run the application using uvicorn
# We use the dynamic $PORT environment variable
CMD uvicorn backend.main:app --host 0.0.0.0 --port $PORT