Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 22 additions & 18 deletions ci/test.Dockerfile
Original file line number Diff line number Diff line change
@@ -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