refactor: simplifier Dockerfile et hook — code via volume, pas image

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gwadaking
2026-04-03 17:13:09 -04:00
parent 00996cb163
commit da7d62fa6a
2 changed files with 16 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
FROM dunglas/frankenphp:latest-php8.3
# Dépendances système
# Dépendances système (GDAL pour vectorisation satellite)
RUN apt-get update && apt-get install -y \
libpq-dev \
libzip-dev \
@@ -20,24 +20,15 @@ RUN install-php-extensions \
opcache \
apcu
# Composer
# Composer (utilisé par le hook post-receive dans le container)
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /app
# Dépendances en premier (cache Docker layer)
COPY backend/composer.json backend/composer.lock ./
RUN composer install --no-dev --optimize-autoloader --no-scripts
# Code source
COPY backend/ .
# Autoload uniquement — pas de cache:warmup ici (besoin de .env.local au runtime)
RUN composer dump-autoload --optimize
COPY docker/php/Caddyfile /etc/caddy/Caddyfile
# Entrypoint : warmup au démarrage du conteneur, quand .env.local est monté
# Le code source et vendor/ sont injectés par volume mount (./backend:/app)
# Le cache warmup nécessite .env.local → fait au démarrage, pas au build
COPY docker/php/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh