install php extensions
This commit is contained in:
parent
e11e314d7e
commit
e5a9d587d1
22
Dockerfile
22
Dockerfile
|
|
@ -1,13 +1,20 @@
|
||||||
# --- Étape de Build ---
|
# --- Étape de Build ---
|
||||||
FROM composer:2.7 AS build
|
FROM composer:2.7 AS build
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
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 . .
|
COPY . .
|
||||||
|
|
||||||
RUN composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
|
RUN composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
|
||||||
|
|
||||||
# --- Étape Finale (Production) ---
|
# --- Étape Finale (Production) ---
|
||||||
FROM dunglas/frankenphp:1.3-php8.4-alpine
|
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 \
|
RUN apk add --no-cache \
|
||||||
libpq-dev \
|
libpq-dev \
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
|
|
@ -15,7 +22,6 @@ RUN apk add --no-cache \
|
||||||
freetype-dev \
|
freetype-dev \
|
||||||
icu-dev
|
icu-dev
|
||||||
|
|
||||||
# Installation des extensions PHP
|
|
||||||
RUN install-php-extensions \
|
RUN install-php-extensions \
|
||||||
intl \
|
intl \
|
||||||
pdo_pgsql \
|
pdo_pgsql \
|
||||||
|
|
@ -25,16 +31,12 @@ RUN install-php-extensions \
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
# Copie des fichiers depuis le build
|
|
||||||
COPY --from=build /var/www/html /var/www/html
|
COPY --from=build /var/www/html /var/www/html
|
||||||
|
|
||||||
# Variables d'environnement pour Laravel
|
# Permissions (crucial pour Laravel)
|
||||||
ENV APP_ENV=production
|
|
||||||
ENV APP_RUNTIME=Laravel\FrankenPHP\Runtime
|
|
||||||
ENV MAX_REQUESTS=500
|
|
||||||
|
|
||||||
# Droits d'accès pour le stockage
|
|
||||||
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
|
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"]
|
CMD ["sh", "-c", "php artisan migrate --force && php artisan storage:link && frankenphp run --config /etc/caddy/Caddyfile"]
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
services:
|
services:
|
||||||
starter-api:
|
starter-api:
|
||||||
build:
|
image: gitea.leonmorival.com/leon-morival/laravel-starter:latest
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
container_name: starter-starter-api-1
|
container_name: starter-starter-api-1
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue