Add Docker infrastructure for dev and prod environments

- Separate PHP Dockerfiles (dev/prod) with extensions and prod opcache/php.ini optimization
- docker-compose-dev: PHP, PostgreSQL, Redis, Messenger, Mailpit, RedisInsight
- docker-compose-prod: 2x PHP replicas, PgSQL master/slave with PgBouncer, 2x Messenger, Redis
- Makefile with build/start/stop/purge commands
- AGENT.md to restrict AI access to the repository

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-18 20:12:09 +01:00
parent 9341647acf
commit 653d7b4729
14 changed files with 378 additions and 0 deletions

28
docker/php/dev/Dockerfile Normal file
View File

@@ -0,0 +1,28 @@
FROM php:8.4-fpm
RUN apt-get update && apt-get install -y \
libpq-dev \
libsqlite3-dev \
libzip-dev \
libxml2-dev \
libicu-dev \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libmagickwand-dev \
unzip \
&& rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install \
pdo_mysql \
pdo_pgsql \
pdo_sqlite \
zip \
xml \
intl \
mbstring \
gd
RUN pecl install redis imagick \
&& docker-php-ext-enable redis imagick

View File

@@ -0,0 +1,32 @@
FROM php:8.4-fpm
RUN apt-get update && apt-get install -y \
libpq-dev \
libsqlite3-dev \
libzip-dev \
libxml2-dev \
libicu-dev \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libmagickwand-dev \
unzip \
&& rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install \
pdo_mysql \
pdo_pgsql \
pdo_sqlite \
zip \
xml \
intl \
mbstring \
gd \
opcache
RUN pecl install redis imagick \
&& docker-php-ext-enable redis imagick
COPY php.ini /usr/local/etc/php/conf.d/app.ini
COPY opcache.ini /usr/local/etc/php/conf.d/opcache.ini

View File

@@ -0,0 +1,9 @@
opcache.enable=1
opcache.memory_consumption=256
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=20000
opcache.validate_timestamps=0
opcache.save_comments=0
opcache.enable_cli=1
opcache.jit=tracing
opcache.jit_buffer_size=128M

21
docker/php/prod/php.ini Normal file
View File

@@ -0,0 +1,21 @@
date.timezone = Europe/Paris
memory_limit = 256M
upload_max_filesize = 100M
post_max_size = 150M
max_execution_time = 30
max_input_time = 30
expose_php = Off
display_errors = Off
display_startup_errors = Off
log_errors = On
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
realpath_cache_size = 4096K
realpath_cache_ttl = 600
session.cookie_secure = On
session.cookie_httponly = On
session.cookie_samesite = Lax
session.use_strict_mode = 1