Files
git-contribution-graph/Dockerfile
T
haylan 4ff45b7c46 feat(store): fetch contributions incrementally and persist history in SQLite
Bound each provider's startFetch()/resolveFetch() to an optional
since/until window, wire a SQLite-backed ContributionStore into
ContributionAggregator (fetch only the trailing window past the last
stored date, merge into the store, prune by CONTRIBUTIONS_RETENTION_DAYS),
and add a graph:contributions:refetch command to force a full or ranged
re-fetch in <=365-day chunks. This is the root fix for the full
365-day-refetch timeout that used to hit on every cache miss.
2026-07-12 23:42:41 +02:00

61 lines
2.1 KiB
Docker

#syntax=docker/dockerfile:1
FROM dunglas/frankenphp:1-php8.4-alpine AS base
RUN apk add --no-cache icu-dev libzip-dev \
&& docker-php-ext-install -j$(nproc) intl opcache zip \
&& apk del icu-dev libzip-dev \
&& apk add --no-cache curl icu-libs libzip \
&& cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
&& mkdir -p $PHP_INI_DIR/app.conf.d
ENV PHP_INI_SCAN_DIR=":$PHP_INI_DIR/app.conf.d"
ENV COMPOSER_ALLOW_SUPERUSER=1
WORKDIR /app
# ── deps stage (prod vendor) ───────────────────────────────────────────────────
FROM base AS deps
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
COPY composer.json composer.lock* ./
RUN composer install \
--no-dev \
--no-scripts \
--no-interaction \
--optimize-autoloader \
--prefer-dist
# ── build stage (generate optimised classmap with source present) ──────────────
FROM deps AS build
COPY . .
RUN composer dump-autoload --classmap-authoritative --no-dev --no-interaction && \
mkdir -p var/cache var/log && \
APP_ENV=prod APP_SECRET=placeholder php bin/console cache:warmup --no-debug && \
composer dump-env prod
# ── final (prod) stage — no composer binary ────────────────────────────────────
FROM base AS final
RUN addgroup -S app && adduser -S -G app app
COPY --link --from=build /app/vendor /app/vendor
COPY --link --from=build /app/var/cache/prod /app/var/cache/prod
COPY --link bin/ ./bin/
COPY --link config/ ./config/
COPY --link public/ ./public/
COPY --link src/ ./src/
COPY --link composer.json composer.lock ./
COPY --link docker/frankenphp/Caddyfile /etc/caddy/Caddyfile
COPY --link docker/php/conf.d/20-app.prod.ini $PHP_INI_DIR/app.conf.d/
RUN chmod +x bin/console && \
mkdir -p var/cache/prod/pools var/log var/data /config/caddy /data/caddy && \
chown -R app:app /app /config /data
USER app
EXPOSE 8080
ENV APP_ENV=prod APP_DEBUG=0
CMD ["frankenphp", "run", "--config", "/etc/caddy/Caddyfile"]