infra!: added CI/CD pipeline and made various improvements
This commit is contained in:
+24
-3
@@ -1,6 +1,7 @@
|
||||
# Dockerfile for Agent Media
|
||||
# Multi-stage build for smaller image size
|
||||
ARG PYTHON_VERSION=3.14.2
|
||||
ARG PYTHON_VERSION
|
||||
ARG PYTHON_VERSION_SHORT
|
||||
ARG RUNNER
|
||||
# ===========================================
|
||||
# Stage 1: Builder
|
||||
@@ -39,7 +40,27 @@ RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
fi
|
||||
|
||||
# ===========================================
|
||||
# Stage 2: Runtime
|
||||
# Stage 2: Testing
|
||||
# ===========================================
|
||||
FROM builder as test
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
--mount=type=cache,target=/root/.cache/pypoetry \
|
||||
--mount=type=cache,target=/root/.cache/uv \
|
||||
if [ "$RUNNER" = "poetry" ]; then \
|
||||
poetry install --no-root; \
|
||||
elif [ "$RUNNER" = "uv" ]; then \
|
||||
uv pip install --system -e .[dev]; \
|
||||
fi
|
||||
|
||||
COPY agent/ ./agent/
|
||||
COPY application/ ./application/
|
||||
COPY domain/ ./domain/
|
||||
COPY infrastructure/ ./infrastructure/
|
||||
COPY tests/ ./tests/
|
||||
COPY app.py .
|
||||
|
||||
# ===========================================
|
||||
# Stage 3: Runtime
|
||||
# ===========================================
|
||||
FROM python:${PYTHON_VERSION}-slim-bookworm as runtime
|
||||
|
||||
@@ -69,7 +90,7 @@ USER appuser
|
||||
WORKDIR /home/appuser/app
|
||||
|
||||
# Copy Python packages from builder stage
|
||||
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
|
||||
COPY --from=builder /usr/local/lib/${PYTHON_VERSION_SHORT}/site-packages /usr/local/lib/${PYTHON_VERSION_SHORT}/site-packages
|
||||
COPY --from=builder /usr/local/bin /usr/local/bin
|
||||
|
||||
# Copy application code (already owned by appuser)
|
||||
|
||||
Reference in New Issue
Block a user