62 lines
2.5 KiB
Docker
62 lines
2.5 KiB
Docker
# ═══════════════════════════════════════════════════════════════════════════════
|
|
# 🦊 Foxy Dev Team — Dockerfile (Multi-stage)
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
# Builds both the backend (Python/FastAPI) and frontend (React/Vite)
|
|
# into a single production-ready image.
|
|
#
|
|
# Build: docker build -t foxy-dev-team .
|
|
# Run: docker run -p 8000:8000 --env-file backend/.env foxy-dev-team
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
# ─── Stage 1: Frontend Build ──────────────────────────────────────────────────
|
|
FROM node:22-alpine AS frontend-build
|
|
|
|
WORKDIR /build
|
|
|
|
COPY frontend/package.json frontend/package-lock.json* ./
|
|
RUN npm ci --silent
|
|
|
|
COPY frontend/ ./
|
|
RUN npm run build
|
|
|
|
# ─── Stage 2: Backend Runtime ─────────────────────────────────────────────────
|
|
FROM python:3.12-slim AS runtime
|
|
|
|
LABEL maintainer="Bruno Charest <bruno@dracodev.net>"
|
|
LABEL description="🦊 Foxy Dev Team — Multi-Agent Orchestration System"
|
|
LABEL version="2.0.0"
|
|
|
|
# System deps
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Create non-root user
|
|
RUN useradd --create-home --shell /bin/bash foxy
|
|
WORKDIR /app
|
|
|
|
# Python dependencies
|
|
COPY backend/requirements.txt ./
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Backend source
|
|
COPY backend/app ./app
|
|
|
|
# Frontend static files (served by FastAPI)
|
|
COPY --from=frontend-build /build/dist ./static
|
|
|
|
# Healthcheck
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD curl -f http://localhost:8000/api/health || exit 1
|
|
|
|
# Runtime config
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
LOG_LEVEL=info
|
|
|
|
EXPOSE 8000
|
|
|
|
USER foxy
|
|
|
|
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|