install php extensions
Laravel CI-CD (Gitea) / Tests Unitaires (push) Successful in 14s Details
Laravel CI-CD (Gitea) / Build & Push Docker (push) Successful in 2m50s Details
Laravel CI-CD (Gitea) / Déploiement Simplifié (push) Successful in 1s Details

This commit is contained in:
Leon 2026-03-13 10:33:13 +01:00
parent e11e314d7e
commit e5a9d587d1
2 changed files with 13 additions and 13 deletions

View File

@ -1,13 +1,20 @@
# --- Étape de Build ---
FROM composer:2.7 AS build
WORKDIR /var/www/html
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions intl zip bcmath pdo_pgsql
COPY . .
RUN composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
# --- Étape Finale (Production) ---
FROM dunglas/frankenphp:1.3-php8.4-alpine
# Installation des dépendances système pour Postgres et GD
# On installe les extensions pour le fonctionnement de l'app en prod
RUN apk add --no-cache \
libpq-dev \
libpng-dev \
@ -15,7 +22,6 @@ RUN apk add --no-cache \
freetype-dev \
icu-dev
# Installation des extensions PHP
RUN install-php-extensions \
intl \
pdo_pgsql \
@ -25,16 +31,12 @@ RUN install-php-extensions \
WORKDIR /var/www/html
# Copie des fichiers depuis le build
COPY --from=build /var/www/html /var/www/html
# Variables d'environnement pour Laravel
ENV APP_ENV=production
ENV APP_RUNTIME=Laravel\FrankenPHP\Runtime
ENV MAX_REQUESTS=500
# Droits d'accès pour le stockage
# Permissions (crucial pour Laravel)
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
# Commande de démarrage
ENV APP_ENV=production
ENV APP_RUNTIME=Laravel\FrankenPHP\Runtime
CMD ["sh", "-c", "php artisan migrate --force && php artisan storage:link && frankenphp run --config /etc/caddy/Caddyfile"]

View File

@ -1,8 +1,6 @@
services:
starter-api:
build:
context: .
dockerfile: Dockerfile
image: gitea.leonmorival.com/leon-morival/laravel-starter:latest
container_name: starter-starter-api-1
restart: unless-stopped
depends_on: