MirrorNest
← Tüm kılavuzlar

Strapi

Strapi is an open-source, JavaScript-based headless CMS; while Strapi doesn't ship an official image, its documentation provides a maintained production Dockerfile and Compose file for containerized deployment.

Hedef: Any Docker hostCMSResmi ana sayfa ↗Resmi belgeler ↗
Bu kılavuz, yukarıda bağlantısı verilen Strapi kendi resmi belgelerinden derlenmiştir — dağıtım ve proje sürümleri zamanla değiştiğinden, bu komutları bir üretim sunucusunda çalıştırmadan önce tam paket/sürüm adlarını her zaman orada kontrol edin.
  1. 1Add the documented production Dockerfile

    Create Dockerfile.prod in your Strapi project using the multi-stage build from Strapi's docs (Node build stage, then a slim production stage running as the non-root node user, exposing port 1337).

  2. 2Add the production Compose file

    Create docker-compose.prod.yml defining the strapi service (built from Dockerfile.prod, port bound to 127.0.0.1:1337) and a strapiDB PostgreSQL service with a health check.

  3. 3Build the image

    docker build -t mystrapiapp:latest -f Dockerfile.prod .
  4. 4Start the stack

    docker compose -f docker-compose.prod.yml up

    Bind Strapi's port to 127.0.0.1 and put a reverse proxy in front for real deployments; keep secrets in a .env file or a proper secrets manager.