Strapi
Strapi is the leading open-source headless CMS that gives developers the freedom to choose their favorite tools and frameworks while allowing content editors to manage content through a beautiful admin panel. It provides a fully customizable API (REST and GraphQL) with auto-generated endpoints based on your content types. This stack deploys Strapi backed by PostgreSQL 16 for production-ready data storage with persistence for uploads and configuration. Strapi features a visual content-type builder, role-based access control, internationalization (i18n), draft/publish workflows, media library, and a plugin marketplace. It supports custom controllers, services, policies, and middlewares for extending the API with custom business logic. After deployment, access the admin panel on port 1337/admin to create your first administrator account and start building your content types.
Services Inclus
strapi
strapi/strapi:latest
Variables d'Environnement :
postgres
postgres:16-alpine
Variables d'Environnement :
YAML Généré
# Generated by ComposeHub (composehub.dev)
name: strapi
services:
strapi:
image: strapi/strapi:latest
restart: always
ports:
- 1337:1337
volumes:
- strapi_app:/srv/app
environment:
DATABASE_CLIENT: postgres
DATABASE_HOST: postgres
DATABASE_PORT: "5432"
DATABASE_NAME: ${POSTGRES_DB:-strapi}
DATABASE_USERNAME: ${POSTGRES_USER:-strapi}
DATABASE_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
JWT_SECRET: ${JWT_SECRET:-changeme-generate-a-random-string}
ADMIN_JWT_SECRET: ${ADMIN_JWT_SECRET:-changeme-generate-a-random-string}
APP_KEYS: ${APP_KEYS:-key1,key2,key3,key4}
API_TOKEN_SALT: ${API_TOKEN_SALT:-changeme}
TRANSFER_TOKEN_SALT: ${TRANSFER_TOKEN_SALT:-changeme}
NODE_ENV: ${NODE_ENV:-production}
networks:
- strapi
depends_on:
postgres:
condition: service_healthy
healthcheck:
test:
- CMD-SHELL
- curl -f http://localhost:1337/_health || exit 1
interval: 30s
timeout: 10s
retries: 5
start_period: 90s
deploy:
resources:
limits:
cpus: "2.00"
memory: 1536M
reservations:
cpus: "0.50"
memory: 512M
labels:
com.composehub.description: Strapi headless CMS application server
postgres:
image: postgres:16-alpine
restart: always
volumes:
- strapi_db:/var/lib/postgresql/data
environment:
POSTGRES_DB: ${POSTGRES_DB:-strapi}
POSTGRES_USER: ${POSTGRES_USER:-strapi}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
networks:
- strapi
healthcheck:
test:
- CMD-SHELL
- pg_isready -U ${POSTGRES_USER:-strapi} -d ${POSTGRES_DB:-strapi}
interval: 5s
timeout: 5s
retries: 10
start_period: 30s
deploy:
resources:
limits:
cpus: "1.00"
memory: 512M
reservations:
cpus: "0.25"
memory: 128M
labels:
com.composehub.description: PostgreSQL 16 database for Strapi
networks:
strapi:
driver: bridge
volumes:
strapi_app:
driver: local
strapi_db:
driver: local
Informations Rapides
- Services
- 2
- Réseaux
- 1
- Volumes
- 2
Quand l'Utiliser
Ce modèle est idéal pour mettre en place un environnement strapi Tous les services sont préconfigurés avec des healthchecks, des limites de ressources et des valeurs par défaut raisonnables. Personnalisez les variables d'environnement avant de déployer en production.
Conseils
- Changez tous les mots de passe par défaut avant le déploiement
- Vérifiez les limites de ressources pour votre matériel
- Ajoutez un reverse proxy pour le HTTPS en production
- Configurez des stratégies de sauvegarde pour les volumes de données