Sign inSign up

dockerha08/strapi

By dockerha08

Updated about 4 hours ago

https://github.com/mainman94/docker-strapi

Image
Content management system
0

2.7K

dockerha08/strapi repository overview

Strapi

docker-strapi

Docker images for Strapi v5 — Alpine and Debian slim, multi-arch, rebuilt on every upstream release.

Docker Pulls Image Size Strapi Version CI Publish License: MIT

Docker Hub · GitHub · Strapi docs


Quick start

docker run -d -p 1337:1337 -e NODE_ENV=development dockerha08/strapi:alpine-latest

Open http://localhost:1337/admin. The container scaffolds a fresh Strapi project with an SQLite database on first boot and starts it.

With Compose, and a bind mount so the project survives the container:

services:
  strapi:
    image: dockerha08/strapi:alpine-latest
    environment:
      NODE_ENV: development # or production
    ports:
      - "1337:1337"
    volumes:
      - ./app:/srv/app # scaffolded here on first boot, reused after

Runnable examples: SQLite · PostgreSQL.

Tags

TagBaseRuns asNotes
alpine-latestnode:24-alpineappuser (non-root)Smallest. Recommended.
alpine-<version>node:24-alpineappuser (non-root)Pinned to a Strapi release.
debian-slim-latestnode:24-trixie-slimrootglibc, for native modules Alpine trips on.
debian-slim-<version>node:24-trixie-slimrootPinned to a Strapi release.

<version> is the upstream Strapi version, e.g. alpine-5.52.3.

Platforms: linux/amd64, linux/arm64. Every published image carries an SBOM and provenance attestation, is signed with cosign (keyless, verify with the command in SECURITY.md), and has OCI labels:

docker buildx imagetools inspect dockerha08/strapi:alpine-latest
docker inspect dockerha08/strapi:alpine-latest --format '{{json .Config.Labels}}' | jq

Variant details: alpine · debian.

How it works

On start, the entrypoint looks at /srv/app:

  • No package.json → runs create-strapi-app to scaffold a project, configured from the DATABASE_* env vars below.
  • Project present, no node_modules → installs dependencies with yarn if a yarn.lock exists, otherwise npm.
  • Then starts Strapi: strapi develop when NODE_ENV=development, strapi start when NODE_ENV=production (building the admin panel first if dist/build/index.html is missing).

The Content-Type Builder is disabled when NODE_ENV=production — that is Strapi's behaviour, not the image's.

To run an existing project, mount it at /srv/app. Anything other than the default command is executed as-is, so docker run ... dockerha08/strapi:alpine-latest sh gives you a shell.

Environment variables

Used when scaffolding a new project:

VariableDefaultDescription
DATABASE_CLIENTsqlitesqlite, postgres or mysql
DATABASE_HOSTDatabase host
DATABASE_PORTDatabase port
DATABASE_NAMEDatabase name
DATABASE_USERNAMEDatabase user
DATABASE_PASSWORDDatabase password
DATABASE_SSLtrue / false
EXTRA_ARGSExtra flags passed to create-strapi-app

Used at runtime:

VariableDefaultDescription
NODE_ENVdevelopmentdevelopmentstrapi develop, productionstrapi start
STRAPI_BUILD_MAX_OLD_SPACE_SIZE2048Node.js heap (MB) for the admin panel build

Strapi's own variables (APP_KEYS, JWT_SECRET, ADMIN_JWT_SECRET, …) are read from the project's .env; set them explicitly for anything long-lived.

Deploying to production

These images are built for scaffolding and development. For production, build an image from your project on top of node:24:

FROM node:24

WORKDIR /app

COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

COPY favicon.ico ./favicon.ico
COPY src/ src/
COPY public/ public/
COPY database/ database/
COPY config/ config/

RUN yarn build

EXPOSE 1337
CMD ["yarn", "start"]

Building locally

docker build -t strapi-alpine-test \
  --build-arg STRAPI_VERSION="$(cat release-versions/strapi-latest.txt)" \
  images/strapi-alpine
./smoke-test.sh strapi-alpine-test

Build args: NODE_VERSION (default 24), STRAPI_VERSION, plus VCS_REF and BUILD_DATE for the OCI labels.

Releases

A daily workflow reads the latest Strapi version and the pinned node:24 digests into release-versions/. Any change there triggers a build of both variants for both platforms, a smoke test on amd64, a push to Docker Hub and a GitHub release. Nothing is pushed that did not boot successfully first.

Contributing

Issues and PRs welcome — see CONTRIBUTING.md, SECURITY.md and the Code of Conduct.

License

MIT. Fork of naskio/docker-strapi, which remains under its original copyright. Strapi is a trademark of Strapi Solutions SAS; this project is not affiliated with or endorsed by Strapi.

Tag summary

Content type

Image

Digest

sha256:8293129f0

Size

107.3 MB

Last updated

about 4 hours ago

docker pull dockerha08/strapi:debian-slim-latest