53 lines
1.6 KiB
Docker
53 lines
1.6 KiB
Docker
# ── Stage 1 : compilation Tippecanoe (non disponible dans bookworm) ────────
|
|
FROM debian:bookworm-slim AS tippecanoe-builder
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
libsqlite3-dev \
|
|
zlib1g-dev \
|
|
git \
|
|
ca-certificates \
|
|
&& git clone --depth=1 https://github.com/felt/tippecanoe.git /tmp/tippecanoe \
|
|
&& make -C /tmp/tippecanoe -j$(nproc) \
|
|
&& strip /tmp/tippecanoe/tippecanoe
|
|
|
|
# ── Stage 2 : image finale ─────────────────────────────────────────────────
|
|
FROM dunglas/frankenphp:latest-php8.3
|
|
|
|
# Binaire Tippecanoe issu du stage de compilation
|
|
COPY --from=tippecanoe-builder /tmp/tippecanoe/tippecanoe /usr/local/bin/tippecanoe
|
|
|
|
# Dépendances système (GDAL pour vectorisation satellite)
|
|
RUN apt-get update && apt-get install -y \
|
|
libpq-dev \
|
|
libzip-dev \
|
|
unzip \
|
|
git \
|
|
gdal-bin \
|
|
python3-gdal \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Extensions PHP
|
|
RUN install-php-extensions \
|
|
pdo_pgsql \
|
|
pgsql \
|
|
redis \
|
|
zip \
|
|
intl \
|
|
opcache \
|
|
apcu
|
|
|
|
# Composer (utilisé par le hook post-receive dans le container)
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
|
|
WORKDIR /app
|
|
|
|
COPY docker/php/Caddyfile /etc/caddy/Caddyfile
|
|
|
|
# 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
|
|
|
|
ENTRYPOINT ["entrypoint.sh"]
|