diff --git a/ci/test.Dockerfile b/ci/test.Dockerfile index c386171..fdcb397 100644 --- a/ci/test.Dockerfile +++ b/ci/test.Dockerfile @@ -1,22 +1,26 @@ -FROM ai-automation-framework-base:latest +FROM --platform=$BUILDPLATFORM python:3.12-slim-bullseye -# Set Playwright browsers path to a fixed location (not dependent on HOME) -ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers +RUN apt-get update && apt-get install -y --no-install-recommends \ + wget \ + zip \ + unzip \ + curl \ + ca-certificates \ + gnupg \ + git \ + chromium \ + chromium-driver \ + && rm -rf /var/lib/apt/lists/* -# Copy dependency files first for better caching -COPY pyproject.toml uv.lock* ./ +# Install uv +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ -# Install Python dependencies -RUN uv sync --frozen --no-dev || uv sync --no-dev +# Set environment variables +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 \ + UV_COMPILE_BYTECODE=1 \ + UV_LINK_MODE=copy \ + CHROME_BIN=/usr/bin/chromium \ + CHROMEDRIVER_PATH=/usr/bin/chromedriver -# Install Playwright browsers and system dependencies -RUN uv run playwright install --with-deps chromium - -# Copy the rest of the application -COPY . . - -# Make .venv and app directory writable for any user (needed for Jenkins user mapping) -RUN chmod -R 777 /app/.venv /app - -# Set default command to run tests -CMD ["uv", "run", "pytest", "--alluredir=allure-results"] +WORKDIR /app