Erster Upload
This commit is contained in:
+47
@@ -0,0 +1,47 @@
|
||||
# Stage 1: Frontend-Assets bauen
|
||||
FROM node:22-alpine AS node
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY resources/ resources/
|
||||
COPY vite.config.js ./
|
||||
RUN mkdir -p public && npm run build
|
||||
|
||||
# Stage 2: FrankenPHP (Caddy + PHP in einem)
|
||||
FROM dunglas/frankenphp:latest-php8.3-alpine
|
||||
|
||||
# PHP-Extensions installieren (install-php-extensions löst System-Deps automatisch)
|
||||
RUN install-php-extensions \
|
||||
pdo_mysql \
|
||||
mbstring \
|
||||
gd \
|
||||
zip \
|
||||
bcmath \
|
||||
intl \
|
||||
exif \
|
||||
pcntl \
|
||||
opcache
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Composer-Dependencies (erst nur json/lock für besseres Layer-Caching)
|
||||
COPY composer.json composer.lock ./
|
||||
RUN composer install --no-dev --no-scripts --no-autoloader --optimize-autoloader
|
||||
|
||||
# App-Code kopieren
|
||||
COPY . .
|
||||
|
||||
# Gebaute Frontend-Assets reinkopieren
|
||||
COPY --from=node /app/public/build public/build/
|
||||
|
||||
# Autoloader finalisieren
|
||||
RUN composer dump-autoload --optimize --no-dev
|
||||
|
||||
# Berechtigungen setzen
|
||||
RUN chown -R www-data:www-data storage bootstrap/cache \
|
||||
&& chmod -R 775 storage bootstrap/cache
|
||||
|
||||
COPY docker/entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
Reference in New Issue
Block a user