Skip to content
Merged
Show file tree
Hide file tree
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
21 changes: 12 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM python:3.13-alpine AS builder
FROM python:3.13-slim AS builder

RUN apk update && apk upgrade --no-cache libcrypto3 libssl3 zlib
RUN apk add --no-cache gcc alpine-sdk linux-headers musl-dev git
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc build-essential git \
&& rm -rf /var/lib/apt/lists/*
RUN pip install poetry==2.2.1

WORKDIR /app
Expand All @@ -14,20 +15,22 @@ COPY ./src/quickapp /app/quickapp
COPY ./config/predefined /app/predefined
RUN poetry install --no-interaction --no-ansi --no-cache --only main

FROM python:3.13-alpine AS runtime
FROM python:3.13-slim AS runtime

RUN apk update && apk upgrade --no-cache libcrypto3 libssl3 libexpat zlib

RUN apk add --no-cache chromium nss freetype harfbuzz ttf-freefont libstdc++
RUN apt-get update && apt-get install -y --no-install-recommends \
chromium fonts-freefont-ttf wget \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYDANTIC_V2=True
PYDANTIC_V2=True \
BROWSER_PATH=/usr/bin/chromium \
CHROME_BIN=/usr/bin/chromium

# Copy the sources and virtual env. No poetry.
RUN adduser -u 1001 --disabled-password --gecos "" appuser
RUN useradd -u 1001 -r -s /sbin/nologin appuser
COPY --chown=appuser --from=builder /app .

RUN echo '#!/bin/sh' > /docker_entrypoint.sh && \
Expand Down
17 changes: 9 additions & 8 deletions src/tests/integration_tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM python:3.13-alpine AS test-builder
FROM python:3.13-slim AS test-builder

RUN apk update && apk upgrade --no-cache libcrypto3 libssl3
RUN apk add --no-cache gcc alpine-sdk linux-headers musl-dev git
RUN pip install poetry==2.1.1
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc build-essential git \
&& rm -rf /var/lib/apt/lists/*
RUN pip install poetry==2.2.1

WORKDIR /app

Expand All @@ -23,13 +24,13 @@ COPY ./integration_tests ./integration_tests


# Stage 2: Test runtime (reuse app runtime base for infra)
FROM python:3.13-alpine AS test-runtime
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3 libexpat
FROM python:3.13-slim AS test-runtime
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*

WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 CHROME_BIN=/usr/bin/chromium
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1

RUN adduser -u 1001 --disabled-password --gecos "" appuser
RUN useradd -u 1001 -r -s /sbin/nologin appuser
COPY --chown=appuser --from=test-builder /app .

COPY --chown=appuser << 'EOF' /docker_test_entrypoint.sh && chmod +x /docker_test_entrypoint.sh
Expand Down
Loading