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.
Servicios Incluidos
strapi
strapi/strapi:latest
Variables de Entorno:
postgres
postgres:16-alpine
Variables de Entorno:
YAML Generado
# 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
Información Rápida
- Servicios
- 2
- Redes
- 1
- Volúmenes
- 2
Cuándo Usar
Esta plantilla es ideal para configurar un entorno de strapi Todos los servicios vienen preconfigurados con healthchecks, límites de recursos y valores por defecto sensatos. Personaliza las variables de entorno antes de desplegar en producción.
Consejos
- Cambia todas las contraseñas por defecto antes de desplegar
- Revisa los límites de recursos para tu hardware
- Añade un proxy inverso para HTTPS en producción
- Configura estrategias de respaldo para los volúmenes de datos