deploiement-prod

Guides production deployment of Toollab via Docker images, GitHub Actions, and Traefik.

Updated May 5, 2025
One-click install
npx skills add https://github.com/sebauvray/toollab-api --skill deploiement-prod-sebauvray
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: deploiement-prod
Source: https://github.com/sebauvray/toollab-api/tree/main/.claude/skills/deploiement-prod
Command: npx skills add https://github.com/sebauvray/toollab-api --skill deploiement-prod-sebauvray

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Deploying the Toollab stack to production involves many fragile steps: building multi-stage Docker images, tagging releases, running migrations safely, configuring workers, and wiring Traefik with TLS. This Skill consolidates the entire production release chain so nothing critical is forgotten or misconfigured. ## Core Features & Use Cases - Release pipeline documentation: Covers git tag triggers, GitHub Actions build-push workflows, and GHCR image tagging for both the API (php-fpm) and front (Nuxt SSR) repositories. - Runtime bootstrap knowledge: Explains the production entrypoint order (storage setup, APP_KEY check, migrate with retry, config/route/view caches, supervisord with 8 queue workers) and the critical php-fpm user configuration. - Infrastructure and rollback guidance: Details Traefik/Let's Encrypt routing, nginx Brotli configuration, critical environment variables, first-time instance provisioning, post-deploy verification, and rollback limits. - Use Case: Before tagging v1.4.0, consult this Skill to confirm both repositories are tagged, migrations have tested up()/down(), and the post-deploy checklist (curl /up, migrate:status, supervisorctl status) is ready. ## Quick Start Ask the assistant to walk you through deploying a new Toollab release to production using the deploiement-prod checklist.

Frequently Asked Questions about deploiement-prod

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a new Toollab version to production?▼

Tag both repositories with git tag v1.4.0 and push the tags. GitHub Actions builds and pushes versioned images to GHCR, then the production entrypoint runs migrations, caches config, and starts supervisord with php-fpm and 8 queue workers.

How do Docker multi-stage builds work for a Laravel production image?▼

The Dockerfile uses four stages: base (php:8.2-fpm with extensions), dev, vendor (composer install without dev dependencies), and prod (copies code and vendor, dumps optimized autoload, adds production entrypoint). The .dockerignore excludes .env, vendor, and .git.

Why does the php-fpm pool run as a custom user instead of www-data?▼

The production pool runs as CURRENT_USER so files uploaded via web requests remain readable and deletable by queue workers. Reverting the sed command that sets this user would break file handling between web requests and background jobs.

Can I rollback a Laravel deployment by redeploying a previous Docker image?▼

Redeploying a previous immutable image tag rolls back the code, but database migrations do not roll back automatically. A destructive migration requires a tested down() method and a database backup taken before the migration.

Why does nginx return 502 after recreating the API container?▼

Without a resolver, nginx caches the upstream IP at startup. The configuration uses resolver 127.0.0.11 with a variable-based fastcgi_pass so nginx re-resolves the container name continuously and avoids stale IPs.

What environment variables are critical for Laravel production?▼

APP_KEY must be set once and never regenerated, APP_DEBUG must be false, and FRONTEND_URL, CORS_ALLOWED_ORIGINS, SUPER_ADMIN_EMAILS, and MAIL settings must be correct. Changing any of them requires config:cache or a container restart.