Files
laraundfelix/Dockerfile
T
LarsandCursor c997eb500c
Deploy Test / test (push) Successful in 2m28s
Deploy Test / deploy (push) Failing after 14s
Leite Vorschaubilder und Filmstufen geschuetzt ab
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-16 09:40:59 +01:00

56 lines
2.7 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# syntax=docker/dockerfile:1
# LUF – Laravel 13 / PHP 8.4 / Filament 5
# Targets: app (php-fpm, auch Queue und Scheduler), web (nginx mit statischen Assets), test (CI)
# Setzt eine Laravel-Anwendung im Repo-Root voraus (composer.json, composer.lock, package.json). Kommt mit U0.
ARG PHP_VERSION=8.4
# ---- Basis: PHP mit den Erweiterungen für Laravel und Filament -------------------------------
FROM php:${PHP_VERSION}-fpm-alpine AS base
RUN apk add --no-cache icu-libs libzip libpng libjpeg-turbo freetype libpq oniguruma su-exec ffmpeg \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS icu-dev libzip-dev libpng-dev libjpeg-turbo-dev freetype-dev postgresql-dev oniguruma-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j"$(nproc)" pdo_pgsql intl zip gd bcmath opcache pcntl exif \
&& apk del .build-deps
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
# ---- Produktions-Abhängigkeiten --------------------------------------------------------------
FROM base AS vendor
COPY composer.json composer.lock ./
RUN composer install --no-dev --no-scripts --no-autoloader --prefer-dist --no-interaction
COPY . .
RUN composer dump-autoload --no-dev --optimize --no-interaction \
&& APP_KEY=base64:MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY= php artisan filament:assets --ansi --no-interaction
# ---- Frontend-Assets (Filament-Theme braucht vendor/) ----------------------------------------
FROM node:22-alpine AS assets
WORKDIR /app
COPY --from=vendor /var/www/html /app
RUN npm ci && npm run build
# ---- Test-Image (CI): inkl. Dev-Abhängigkeiten, führt Pint und Tests aus ---------------------
FROM base AS test
COPY composer.json composer.lock ./
RUN composer install --prefer-dist --no-scripts --no-autoloader --no-interaction
COPY . .
RUN composer dump-autoload --optimize --no-interaction
ENV APP_ENV=testing
CMD ["sh", "-ec", "if [ -x vendor/bin/pint ]; then vendor/bin/pint --test; fi; php artisan test --compact"]
# ---- App (php-fpm; derselbe Tag dient für Queue und Scheduler) -------------------------------
FROM base AS app
COPY --from=vendor /var/www/html /var/www/html
COPY --from=assets /app/public/build /var/www/html/public/build
COPY docker/entrypoint.sh /usr/local/bin/entrypoint
COPY docker/php.ini /usr/local/etc/php/conf.d/zz-luf.ini
RUN chmod +x /usr/local/bin/entrypoint
ENTRYPOINT ["entrypoint"]
CMD ["php-fpm"]
# ---- Web (nginx, nur öffentliche Dateien) ----------------------------------------------------
FROM nginx:1.27-alpine AS web
COPY docker/nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=vendor /var/www/html/public /var/www/html/public
COPY --from=assets /app/public/build /var/www/html/public/build