feat: test ci/cd

This commit is contained in:
leon-morival 2025-11-30 15:49:40 +01:00
parent ff618b4b39
commit ccb616ac7f
1 changed files with 10 additions and 8 deletions

View File

@ -1,5 +1,3 @@
# Dockerfile
FROM laravelsail/php84-composer AS build
WORKDIR /var/www/html
@ -10,22 +8,26 @@ COPY . .
# Installer les dépendances PHP (prod)
RUN composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
# Build des assets si tu utilises Vite
# Si tu as du front (Vite), tu pourrais ajouter :
# RUN npm ci && npm run build
# -----------------------------
# Image finale (runtime)
# Étape 2 : runtime
# -----------------------------
FROM laravelsail/php84-composer
WORKDIR /var/www/html
# Copier les fichiers depuis létape build
COPY --from=build /var/www/html /var/www/html
# Optimisations Laravel
RUN php artisan config:cache \
&& php artisan route:cache
# (Optionnel) Tu peux retirer les fichiers inutiles ici (tests, etc.)
# ⚠️ On désactive l'ENTRYPOINT de l'image de base
ENTRYPOINT []
# Port HTTP exposé dans le container
EXPOSE 80
CMD ["php-fpm"]
# Lancer Laravel via php artisan serve
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=80"]