MirrorNest
← Tous les guides

Directus

Directus is a headless CMS and data platform that wraps a REST/GraphQL API and an admin app around your own SQL database, deployed via an official Docker Compose example.

Système : Any Docker hostDatabaseCMSSite officiel ↗Documentation officielle ↗
Ce guide est élaboré à partir de la documentation officielle de Directus, dont le lien figure ci-dessus — vérifiez toujours les noms exacts des paquets/versions avant d'exécuter ces commandes sur un serveur de production, car les versions de la distribution et du projet évoluent avec le temps.
  1. 1Create your project directory

    Create a directus/ directory with database, uploads, and extensions subfolders to persist data outside the container.

  2. 2Write a production docker-compose.yml

    Directus's official example wires together a directus service, a PostGIS/PostgreSQL database service, and a Redis cache service.

    Set DB_CLIENT=pg with DB_HOST/DB_PORT/DB_DATABASE/DB_USER/DB_PASSWORD pointing at the database service, and CACHE_STORE=redis with REDIS pointing at the cache service.

  3. 3Set the required secret and admin account

    Set a unique SECRET value (used to sign tokens) and, optionally, ADMIN_EMAIL and ADMIN_PASSWORD to pre-seed the first admin account, plus PUBLIC_URL for your deployment's address.

  4. 4Start Directus

    docker compose up -d
  5. 5Log in

    Open your PUBLIC_URL. If you didn't pre-set ADMIN_EMAIL/ADMIN_PASSWORD, Directus will walk you through its Studio onboarding screen to create the first admin account.

    Check container health via the built-in /server/health and /server/ping endpoints.