-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (28 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
37 lines (28 loc) · 1.1 KB
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
30
31
32
33
34
35
36
37
# Dockerfile for RevGeniAgent - FastAPI (CrewAI) service on Cloud Run
# Lightweight Python base image
FROM python:3.11-slim
# Prevent Python from writing .pyc files and enable unbuffered logs
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
# Set workdir
WORKDIR /app
# Install system dependencies (build-essential often needed for some pip packages)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential curl && \
rm -rf /var/lib/apt/lists/*
# Copy requirements first (better layer caching)
COPY requirements.txt ./
RUN pip install --upgrade pip && pip install -r requirements.txt
# Copy application source
COPY . .
# Create non-root user for security
RUN useradd -m revuser
USER revuser
# Cloud Run will inject PORT; provide default for local docker run
ENV PORT=8080
# Expose port (optional for Cloud Run, helpful locally)
EXPOSE 8080
# Health: FastAPI root /health is sufficient; Cloud Run does its own checks
# Start with uvicorn directly (no reload; production mode)
CMD ["bash", "-c", "uvicorn api.server:app --host 0.0.0.0 --port ${PORT:-8080}"]