mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-08-11 00:30:12 -04:00
45 lines
1.1 KiB
Text
45 lines
1.1 KiB
Text
# Test image for running backend and frontend tests
|
|
FROM python:3.13-slim AS backend-test
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies for testing
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Python dependencies including test dependencies
|
|
COPY requirements.txt ./
|
|
COPY requirements-dev.txt ./
|
|
RUN pip install --no-cache-dir -r requirements.txt -r requirements-dev.txt
|
|
|
|
# Copy backend code
|
|
COPY backend/ ./backend/
|
|
COPY pyproject.toml ./
|
|
|
|
# Create necessary directories
|
|
RUN mkdir -p /app/data /app/logs /app/archive
|
|
|
|
# Environment variables for testing
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV DATA_DIR=/app/data
|
|
ENV TESTING=1
|
|
|
|
# Default command runs pytest (excluding docker integration tests)
|
|
CMD ["pytest", "backend/tests/", "-v", "--tb=short", "-p", "no:cacheprovider", "-n", "30"]
|
|
|
|
# -------------------------------------------
|
|
# Frontend test stage
|
|
FROM node:22-bookworm-slim AS frontend-test
|
|
|
|
WORKDIR /app/frontend
|
|
|
|
# Copy package files and install
|
|
COPY frontend/package*.json ./
|
|
RUN npm ci
|
|
|
|
# Copy frontend source
|
|
COPY frontend/ ./
|
|
|
|
# Default command runs tests
|
|
CMD ["npm", "test", "--", "--run"]
|