feat: test ci/cd
This commit is contained in:
parent
ff618b4b39
commit
ccb616ac7f
18
Dockerfile
18
Dockerfile
|
|
@ -1,5 +1,3 @@
|
||||||
# Dockerfile
|
|
||||||
|
|
||||||
FROM laravelsail/php84-composer AS build
|
FROM laravelsail/php84-composer AS build
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
@ -10,22 +8,26 @@ COPY . .
|
||||||
# Installer les dépendances PHP (prod)
|
# Installer les dépendances PHP (prod)
|
||||||
RUN composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
|
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
|
# RUN npm ci && npm run build
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
# Image finale (runtime)
|
# Étape 2 : runtime
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
FROM laravelsail/php84-composer
|
FROM laravelsail/php84-composer
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
# Copier les fichiers depuis l’étape build
|
||||||
COPY --from=build /var/www/html /var/www/html
|
COPY --from=build /var/www/html /var/www/html
|
||||||
|
|
||||||
# Optimisations Laravel
|
# (Optionnel) Tu peux retirer les fichiers inutiles ici (tests, etc.)
|
||||||
RUN php artisan config:cache \
|
|
||||||
&& php artisan route:cache
|
|
||||||
|
|
||||||
|
# ⚠️ On désactive l'ENTRYPOINT de l'image de base
|
||||||
|
ENTRYPOINT []
|
||||||
|
|
||||||
|
# Port HTTP exposé dans le container
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
CMD ["php-fpm"]
|
# Lancer Laravel via php artisan serve
|
||||||
|
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=80"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue