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.
Enthaltene Services
strapi
strapi/strapi:latest
Umgebungsvariablen:
postgres
postgres:16-alpine
Umgebungsvariablen:
Generiertes YAML
# 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
Kurzinfo
- Services
- 2
- Netzwerke
- 1
- Volumes
- 2
Wann verwenden
Dieses Template ist ideal für die Einrichtung einer strapi Umgebung. Alle Services sind mit Healthchecks, Ressourcenlimits und sinnvollen Standardwerten vorkonfiguriert. Passen Sie die Umgebungsvariablen an, bevor Sie in Produktion gehen.
Tipps
- Ändern Sie alle Standardpasswörter vor dem Deployment
- Überprüfen Sie die Ressourcenlimits für Ihre Hardware
- Fügen Sie einen Reverse Proxy für HTTPS in Produktion hinzu
- Konfigurieren Sie Backup-Strategien für Daten-Volumes