Complete MVP implementation including: - PHP 8.4 backend with Front Controller pattern (80+ API endpoints) - Multi-tenant architecture with organization_id isolation - JWT authentication (HS256, 2h access + 7d refresh tokens) - 14 controllers: Auth, Organization, Assessment, Dashboard, Risk, Incident, Policy, SupplyChain, Training, Asset, Audit, Admin - AI Service integration (Anthropic Claude API) for gap analysis, risk suggestions, policy generation, incident classification - NIS2 gap analysis questionnaire (~80 questions, 10 categories) - MySQL schema (20 tables) with NIS2 Art. 21 compliance controls - NIS2 Art. 23 incident reporting workflow (24h/72h/30d) - Frontend: login, register, dashboard, assessment wizard, org setup - Docker configuration (PHP-FPM + Nginx + MySQL) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
78 lines
2.7 KiB
YAML
78 lines
2.7 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# ── PHP-FPM Application ──────────────────────────────────────────────────
|
|
app:
|
|
build:
|
|
context: ..
|
|
dockerfile: docker/Dockerfile
|
|
container_name: nis2-app
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ../application:/var/www/nis2-agile/application
|
|
- ../public:/var/www/nis2-agile/public
|
|
environment:
|
|
- APP_ENV=${APP_ENV:-production}
|
|
- APP_DEBUG=${APP_DEBUG:-false}
|
|
- DB_HOST=db
|
|
- DB_PORT=3306
|
|
- DB_DATABASE=${DB_DATABASE:-nis2_agile_db}
|
|
- DB_USERNAME=${DB_USERNAME:-nis2_user}
|
|
- DB_PASSWORD=${DB_PASSWORD}
|
|
- JWT_SECRET=${JWT_SECRET}
|
|
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
|
|
networks:
|
|
- nis2-network
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
|
|
# ── Nginx Web Server ─────────────────────────────────────────────────────
|
|
web:
|
|
image: nginx:1.25-alpine
|
|
container_name: nis2-web
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${WEB_PORT:-8080}:8080"
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
- ../public:/var/www/nis2-agile/public:ro
|
|
networks:
|
|
- nis2-network
|
|
depends_on:
|
|
- app
|
|
|
|
# ── MySQL Database ───────────────────────────────────────────────────────
|
|
db:
|
|
image: mysql:8.0
|
|
container_name: nis2-db
|
|
restart: unless-stopped
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
|
|
MYSQL_DATABASE: ${DB_DATABASE:-nis2_agile_db}
|
|
MYSQL_USER: ${DB_USERNAME:-nis2_user}
|
|
MYSQL_PASSWORD: ${DB_PASSWORD}
|
|
ports:
|
|
- "${DB_PORT:-3306}:3306"
|
|
volumes:
|
|
- nis2-db-data:/var/lib/mysql
|
|
- ../docs/sql/001_initial_schema.sql:/docker-entrypoint-initdb.d/001_initial_schema.sql:ro
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_ROOT_PASSWORD}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
networks:
|
|
- nis2-network
|
|
|
|
# ── Volumes ──────────────────────────────────────────────────────────────
|
|
volumes:
|
|
nis2-db-data:
|
|
driver: local
|
|
|
|
# ── Networks ─────────────────────────────────────────────────────────────
|
|
networks:
|
|
nis2-network:
|
|
driver: bridge
|