feat: ci/cd
ci.yml / 🧪 Tests Laravel (push) Has been cancelled
ci.yml / 🐳 Build & Push Image (push) Has been cancelled

This commit is contained in:
2026-07-10 15:28:23 +02:00
parent b7079e1e42
commit 55a30b8db8
12 changed files with 707 additions and 377 deletions
+29 -85
View File
@@ -1,102 +1,46 @@
# ============================================================
# Docker Compose — Production
#
# Architecture :
# [Nginx Proxy Manager] ──► [FrankenPHP app:80]
# │
# [PostgreSQL]
# [Queue Worker]
#
# Le réseau "proxy" est externe (géré par Nginx Proxy Manager).
# Dans NPM, configure un proxy host vers : http://landing-api-app:80
#
# Usage :
# docker compose -f compose.prod.yaml up -d
# ============================================================
services:
# ── Application FrankenPHP (web + PHP tout-en-un) ───────
app:
build:
context: .
dockerfile: docker/Dockerfile.prod
image: landing-api:latest
container_name: landing-api-app
image: git.leonmorival.xyz/leon/landing-api:latest
container_name: landing-api
restart: unless-stopped
env_file:
- .env
environment:
APP_ENV: production
APP_DEBUG: "false"
SERVER_NAME: ":80" # FrankenPHP écoute sur le port 80
volumes:
- app_storage:/app/storage/app
- app_logs:/app/storage/logs
networks:
- proxy # réseau NPM pour être accessible depuis l'extérieur
- internal # réseau interne pour parler à PostgreSQL
depends_on:
pgsql:
condition: service_healthy
# ── Base de données PostgreSQL ──────────────────────────
pgsql:
image: postgres:17-alpine
container_name: landing-api-pgsql
restart: unless-stopped
environment:
POSTGRES_DB: "${DB_DATABASE}"
POSTGRES_USER: "${DB_USERNAME}"
POSTGRES_PASSWORD: "${DB_PASSWORD}"
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- pgsql_data:/var/lib/postgresql/data
networks:
- internal # PostgreSQL n'est PAS exposé sur le réseau proxy
healthcheck:
test: ["CMD-SHELL", "pg_isready -q -d ${DB_DATABASE} -U ${DB_USERNAME}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
- proxy
- database
# ── Worker Laravel Queue ────────────────────────────────
queue:
build:
context: .
dockerfile: docker/Dockerfile.prod
image: landing-api:latest
container_name: landing-api-queue
restart: unless-stopped
command: ["php", "artisan", "queue:work", "--sleep=3", "--tries=3", "--max-time=3600"]
env_file:
- .env
environment:
APP_ENV: production
APP_DEBUG: "false"
volumes:
- app_storage:/app/storage/app
- app_logs:/app/storage/logs
- storage:/var/www/html/storage
postgres:
image: postgres:16
container_name: landing-api-postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- internal
depends_on:
pgsql:
condition: service_healthy
- database
volumes:
storage:
postgres-data:
networks:
# Réseau externe partagé avec Nginx Proxy Manager
proxy:
external: true
# Réseau interne isolé (app ↔ pgsql ↔ queue)
internal:
database:
driver: bridge
volumes:
pgsql_data:
driver: local
app_storage:
driver: local
app_logs:
driver: local