mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-07-13 13:25:19 +02:00
b4a27a7c0d
* Migrate frontend to TypeScript with Deno-based tooling (#206) Compiles assets/*.ts via sensiolabs/typescript-bundle (standalone SWC binary) and adds Deno for formatting, linting, type-checking, and tests, keeping the project's no-Node/npm approach intact. Wires all four into CI, the Justfile, and the pre-commit hook. * fix: build TypeScript assets before running PHPUnit in CI The tests job ran bin/console sass:build but never typescript:build, so var/typescript/ didn't exist and any page rendering the importmap (e.g. backoffice/base.html.twig) errored during tests. * test: add regression test for backoffice navbar-toggler dead target Guards against the navbar-toggler button pointing at a collapse target (#navbarSupportedContent) that isn't rendered for the current user — the bug hit on the login page before #210 restructured the nav to always render at least one item (the Releases link) regardless of auth state. * fix: stop hand-enumerating TS files for deno check deno check assets/*.ts assets/controllers/*.ts assets/controllers/bo/*.ts was duplicated in CI and the Justfile, and silently misses any new controller subdirectory (fmt/lint/test already recurse assets/ via deno.json). Add a top-level exclude for assets/vendor/ (respected by all deno subcommands, unlike the per-task include/exclude blocks) so deno check assets/ can recurse safely instead. * fix: GitHubReleasesService date parsing and falsy release name - Move the release-mapping array_map inside the try block so a malformed published_at (or any other parse failure) degrades to the same empty-list fallback as an HTTP failure, instead of throwing uncaught out of the cache callback. - Stop treating a release literally named "0" as unnamed — the old `?:` fallback is falsy for that string and silently substituted the tag name instead. - Render release dates in UTC explicitly; Twig's date filter otherwise silently converts to the app's default timezone (Europe/Amsterdam), which could show the wrong calendar day for releases near midnight. * docs: add scope-creep-as-a-service rule to CLAUDE.md Per user instruction: when a review turns up a real bug outside the current task's scope, fix it in the same MR (with a regression test) rather than just reporting it, unless it needs a human design call.
123 lines
3.3 KiB
Docker
123 lines
3.3 KiB
Docker
#syntax=docker/dockerfile:1
|
|
|
|
# Versions
|
|
FROM dunglas/frankenphp:1-php8.5 AS frankenphp_upstream
|
|
|
|
# The different stages of this Dockerfile are meant to be built into separate images
|
|
# https://docs.docker.com/develop/develop-images/multistage-build/#stop-at-a-specific-build-stage
|
|
# https://docs.docker.com/compose/compose-file/#target
|
|
|
|
|
|
# Base FrankenPHP image
|
|
FROM frankenphp_upstream AS frankenphp_base
|
|
|
|
WORKDIR /app
|
|
|
|
VOLUME /app/var/
|
|
|
|
# persistent / runtime deps
|
|
# hadolint ignore=DL3008
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
acl \
|
|
file \
|
|
gettext \
|
|
git \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN set -eux; \
|
|
install-php-extensions \
|
|
@composer \
|
|
apcu \
|
|
intl \
|
|
opcache \
|
|
zip \
|
|
gd \
|
|
;
|
|
|
|
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
|
|
ENV COMPOSER_ALLOW_SUPERUSER=1
|
|
|
|
ENV PHP_INI_SCAN_DIR=":$PHP_INI_DIR/app.conf.d"
|
|
|
|
###> recipes ###
|
|
###> doctrine/doctrine-bundle ###
|
|
RUN install-php-extensions pdo_pgsql
|
|
###< doctrine/doctrine-bundle ###
|
|
###< recipes ###
|
|
|
|
COPY --link frankenphp/conf.d/10-app.ini $PHP_INI_DIR/app.conf.d/
|
|
COPY --link --chmod=755 frankenphp/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
|
|
COPY --link frankenphp/Caddyfile /etc/caddy/Caddyfile
|
|
|
|
ENTRYPOINT ["docker-entrypoint"]
|
|
|
|
HEALTHCHECK --start-period=60s CMD curl -f http://localhost:2019/metrics || exit 1
|
|
CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile" ]
|
|
|
|
# Dev FrankenPHP image
|
|
FROM frankenphp_base AS frankenphp_dev
|
|
|
|
ENV APP_ENV=dev XDEBUG_MODE=off
|
|
|
|
# hadolint ignore=DL3008
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
bash-completion \
|
|
unzip \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --link frankenphp/console-complete.bash /usr/share/bash-completion/completions/console
|
|
COPY --link frankenphp/composer-complete.bash /usr/share/bash-completion/completions/composer
|
|
|
|
# Deno: standalone binary (no Node/npm) used for TypeScript lint/format/type-check/test,
|
|
# dev-only tooling so it's not installed in the prod stage.
|
|
ENV DENO_INSTALL=/usr/local
|
|
# hadolint ignore=DL4006
|
|
RUN curl -fsSL https://deno.land/install.sh | sh -s v2.9.2
|
|
|
|
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
|
|
|
|
RUN set -eux; \
|
|
install-php-extensions \
|
|
xdebug/xdebug@3.5.0 \
|
|
;
|
|
|
|
COPY --link frankenphp/conf.d/20-app.dev.ini $PHP_INI_DIR/app.conf.d/
|
|
|
|
RUN git config --global --add safe.directory /app
|
|
|
|
CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile", "--watch" ]
|
|
|
|
# Prod FrankenPHP image
|
|
FROM frankenphp_base AS frankenphp_prod
|
|
|
|
RUN rm -rf /var/lib/apt/lists/*
|
|
|
|
ENV APP_ENV=prod
|
|
|
|
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
|
|
|
|
COPY --link frankenphp/conf.d/20-app.prod.ini $PHP_INI_DIR/app.conf.d/
|
|
|
|
# prevent the reinstallation of vendors at every changes in the source code
|
|
COPY --link composer.* symfony.* ./
|
|
RUN set -eux; \
|
|
composer install --no-cache --prefer-dist --no-dev --no-autoloader --no-scripts --no-progress
|
|
|
|
# copy sources
|
|
COPY --link . ./
|
|
RUN rm -Rf frankenphp/
|
|
|
|
RUN set -eux; \
|
|
mkdir -p var/cache var/log; \
|
|
composer dump-autoload --classmap-authoritative --no-dev; \
|
|
composer dump-env prod; \
|
|
composer run-script --no-dev post-install-cmd; \
|
|
chmod +x bin/console; \
|
|
bin/console sass:build; \
|
|
bin/console asset-map:compile --no-debug --quiet --no-ansi; \
|
|
sync;
|
|
|
|
# Build timestamp for /.well-known/security.txt Expires; must be injected last to avoid cache busting.
|
|
ARG BUILD_TIME=""
|
|
ENV BUILD_TIME=$BUILD_TIME
|