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

82
docker-compose-dev.yml Normal file
View File

@@ -0,0 +1,82 @@
services:
php:
build:
context: ./docker/php/dev
dockerfile: Dockerfile
container_name: e-ticket_php
restart: unless-stopped
volumes:
- .:/app
ports:
- "9000:9000"
depends_on:
database:
condition: service_healthy
redis:
condition: service_healthy
database:
image: postgres:16-alpine
container_name: e-ticket_database
environment:
POSTGRES_USER: app
POSTGRES_PASSWORD: secret
POSTGRES_DB: e-ticket
ports:
- "5432:5432"
volumes:
- db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U app -d e-ticket"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: e-ticket_redis
command: redis-server --requirepass e-ticket
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "e-ticket", "ping"]
interval: 5s
timeout: 5s
retries: 5
messenger:
build:
context: ./docker/php/dev
dockerfile: Dockerfile
container_name: e-ticket_messenger
command: php bin/console messenger:consume async -vv
restart: unless-stopped
volumes:
- .:/app
depends_on:
database:
condition: service_healthy
redis:
condition: service_healthy
mailpit:
image: axllent/mailpit
container_name: e-ticket_mailpit
ports:
- "1025:1025"
- "8025:8025"
redisinsight:
image: redis/redisinsight:latest
container_name: e-ticket_redisinsight
ports:
- "5540:5540"
depends_on:
redis:
condition: service_healthy
volumes:
db-data:
redis-data: