轩辕镜像 官方专业版
轩辕镜像
专业版
轩辕镜像 官方专业版
轩辕镜像
专业版
首页个人中心搜索镜像
交易
充值流量¥7起我的订单
文档
工具
提交工单页面收录
strapi

vshadbolt/strapi

vshadbolt

用于Strapi v4+和v5+的Docker镜像,支持创建新Strapi项目或运行现有项目,可通过环境变量配置数据库、URL、CORS等参数,支持开发和生产模式,简化API和内容管理框架的部署。

1 次收藏下载次数: 0状态:社区镜像维护者:vshadbolt仓库类型:镜像最近更新:12 天前
让 AI 帮你使用轩辕镜像? · 展开查看说明 · 点击收起说明

如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。

只需在 AI 对话中先发送下面这句话即可:

请先完整阅读并严格遵守以下文档中的全部规则与要求:

https://xuanyuan.cloud/agents.md

在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。

查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。

DockerHub 官方简介
轩辕镜像中文简介
下载命令
镜像标签列表与下载命令
轩辕镜像,不浪费每一次拉取。
点击查看

Strapi (v4+ and v5+) containerized

!https://github.com/V-Shadbolt/Docker-strapi/blob/main/assets/PNG.logo.purple.dark.png?raw=true

Docker image for Strapi v4 and Strapi v5 (latest version)

API creation made simple, secure and fast. The most advanced open-source Content Management Framework to build powerful API with no effort.

https://github.com/V-Shadbolt/Docker-strapi

https://hub.Docker.com/r/vshadbolt/strapi


How to use ?

This image allows you to create a new Strapi project or run an existing Strapi project in Docker.

For either new or existing projects, changing the NODE_ENV environment variable will determine how your projects starts.

  • $NODE_ENV = development: The command that will run in your project in dev mode with strapi develop.

  • for $NODE_ENV = production: The command that will run in your project in prod mode with strapi start.

The Content-Type Builder plugin is disabled WHEN $NODE_ENV = production.


Creating a new Strapi project

When running this image, Strapi will check if there is a project in the /srv/app folder of the container. If there is not an existing project, it will run the create strapi-app command in the containers' /srv/app folder.

This command defaults to creating a project with an SQLite database and then starts Strapi on port 1337.

However, this image overwrites the unconfigured config/admin.js, config/server.js, and config/middlewares.js files to accomodate setting image sources, CORS params, admin url(s), and public server url(s) as Docker ENV variables. See below for example configurations.

  • ADMIN_URL: tobemodified: Sets a custom sub/domain for your admin page. Ex. https://api.example.com/admin. Without adding the command, the config will default to http://localhost:1337/admin.

  • PUBLIC_URL: tobemodified: Sets a custom domain for your api endpoint(s). Ex. https://api.example.com. Without adding the env variable, the config will default to http://localhost:1337

  • IMG_ORIGIN: "toBeModified1,toBeModified2": Add new image sources for your project. Ex. 'self',data:,blob:,market-assets.strapi.io,api.example.com. Without adding the env variable, the config will default to 'self',data:,blob:,market-assets.strapi.io

  • CORS_ORIGIN: "toBeModified1,toBeModified2": Add new CORS origin sources to your project. Ex. https://myfrontendwebsite.example.com,https://api.example.com. Without adding the env variable, the config will default to *.

The ADMIN_URL and PUBLIC_URL default will throw errors if your Docker host is remote. You'll need to set your Docker host IP at the minimum for remote projects. Ex. http://192.168.1.1:1337. Ideally use an nginx proxy setup or sub/domain. If your host is not remote, http://localhost:1337 will work as expected.

Along with the above, the image also supports configuring database settings:

  • DATABASE_CLIENT: tobemodified: A database provider supported by Strapi: (sqlite, postgres, mysql ,mongo). E.x. postgres

  • DATABASE_HOST: database host IP / container name: The database host IP or container name. Ex. strapiDB

  • DATABASE_PORT: database host port / container port: The database host port or container port. Ex. 5432

  • DATABASE_NAME: tobemodified: The name of the database. Ex. strapi

  • DATABASE_USERNAME: tobemodified: The username for the database. Ex. strapi

  • DATABASE_PASSWORD: tobemodified: The password for the database. Ex. strapi

  • DATABASE_SSL: tobemodified: A boolean for SSL. Ex. false

Next, we can set secrets for Strapi to use. All of these are random strings than can be generated.

  • JWT_SECRET: tobemodified: A random string. Ex. JrWfVf/o9TbWQmpMgsJaYp==

  • ADMIN_JWT_SECRET: tobemodified: A random string. Ex. MCpf2/FMiCJthF5d6Qup6iG==

  • APP_KEYS: toBeModified1,toBeModified2: Multiple random strings. Ex. w9/ZTuHUWNF2EP8gdfPcNn==,LqXKC52TsN/z/Y2rUGTa6m==,d7EKo2Tp9SiGf82ZqrmSnB==,TAu2SJx6BDc7aYUyqiwxKs==

  • API_TOKEN_SALT: tobemodified: A random string. Ex. j43/kBRfXULfPpJnzPCJzi==

  • TRANSFER_TOKEN_SALT: tobemodified: A random string. Ex. GCX3NkRSyHrDxhfgwnmCm3==

Finally, we have a variable for re-building Strapi. After modifying any of the files in the /config directory or changing their respective environment variables (ADMIN_URL, PUBLIC_URL, IMG_ORIGIN, CORS_ORIGIN), the project will need to be rebuilt to account for the changes. To do so, add the following configuration to the Docker command/compose file. Note that not adding this argument will negate any changes made within the /config directory until it is added. It is particularily important for any URL changes or your project will not function as expected. The build will be persisted between container restarts and is specific to /config changes.

  • BUILD: tobemodified: A boolean for re-building the Strapi project. Ex. true

Reverse Proxy Support

When running Strapi behind a reverse proxy (like Caddy, Nginx, or Traefik) in development mode (NODE_ENV=development), you might encounter the error:

Blocked request. This host ("api.example.com") is not allowed.
To allow this host, add "api.example.com" to `server.allowedHosts` in vite.config.js.

This happens because Vite (the development server) blocks requests from hosts that aren't explicitly allowed. To fix this, you can use:

  • ENABLE_VITE_ALLOWED_HOSTS: tobemodified: A boolean to enable Vite allowed hosts fix. Ex. true

When set to true, this will automatically create a vite.config.js (for JavaScript projects) or vite.config.ts (for TypeScript projects) file that allows all hosts, resolving the reverse proxy issue. The script automatically detects the project type and creates the appropriate configuration file.

Here is a completed example https://github.com/V-Shadbolt/docker-strapi/blob/main/./examples/strapi-postgres/docker-compose.yml for the available environment variables as well as the configuration for a postgres database. You can find more examples https://github.com/V-Shadbolt/docker-strapi/tree/main/examples.

  • The official documentation for Strapi and these files is linked below.

Migrating an existing Strapi project

To run an existing project that was not created with this image, you can mount the project folder in the container at /srv/app. The project will need to be modified directly rather than relying on Docker env variables. Remember to also ensure your existing database is still accessible from the migrated project. It is also possible to migrate your DB to Docker as well and reference it as a volume for your DB image. Ensure the DB image is the same version as your existing DB to avoid hiccups. Remember to backup responsibly.

For existing projects, config/admin.js, config/server.js, and config/middlewares.js files will need to be configured to not use http://localhost:1337 if they haven't been already unless your host is local.

For existing projects that were created using this image an your are migrating to a different machine, you can mount the project folder in the container at /srv/app and take advantage of the environment variables outlined above to make modifications to your project. Your Database can also be migrated following the same logic.


Updating Strapi

V4+

To upgrade Strapi v4+, stop your Strapi container and pull the image / update your compose file with the respective tag for the Strapi version you would like to upgrade to: :4.x.x or :latest-v4. Then re-create your Strapi container with the new image.

Note the upgrade process is very slow, automatic, and will upgrade across minor and patch versions. There may be breaking changes between upgrades. Please remember to backup responsibly.

V4 to V5

:warning: Proceed with caution. To upgrade from Strapi v4 to Strapi v5, stop your Strapi container and pull the latest image / update your compose file with the latest or any :5.x.x tag. Then re-create your Strapi container with the new image. The image should handle the migration without user intervention outside of Database and API changes. Ensure you have a backup in place as the new Strapi Upgrade Tool may fail with unresolvable dependency conflicts, may not properly update the codebase, or cause your existing configuration to break.

Official Upgrade Guide

Note the upgrade process can be slow, intensive, and will upgrade across major, minor, and patch versions. There may be breaking changes between upgrades. Please remember to backup responsibly.

V5+

To upgrade Strapi v5+, stop your Strapi container and and pull the image / update your compose file with the respective tag for the Strapi version you would like to upgrade to: :5.x.x or :latest.. Then re-create your Strapi container with the new image.

:warning: Strapi v5 now utilizes an Upgrade Tool that may fail with unresolvable dependency conflicts or otherwise loop. Also Note the upgrade process can be slow and will upgrade across minor and patch versions. There may be breaking changes between upgrades. Please remember to backup responsibly.


Missing React modules for Strapi v4.15.5+

The Docker entrypoint and Docker file have been modified to replace the strapi new command (now deprecated) with npx create strapi-app which will gather the required packages. With this change, the image is now substantially smaller. For existing Strapi projects, the updated entrypoint will add the missing packages [react, react-dom, react-router-dom, styled-components] if they haven't already been installed. Please remember to backup responsibly.


Strapi Cloud v4.25.0+

The Docker entrypoint has been modified to skip the Strapi Cloud setup for new Strapi projects. Strapi Cloud is meant to host your Strapi instance which is an alternative to this image. You can read more about Strapi Cloud here.


Cannot find module 'pg'

The Docker entrypoint has been modified to add the missing pg modules if the Strapi database is configured to use Postgres starting in v5.6.0 and v4.25.16.


Cannot find module 'mysql'

The Docker entrypoint has been modified to add the missing mysql modules if the Strapi database is configured to use MySQL starting in v5.10.2 and v4.25.20.


Official Documentation

  • The official documentation of Strapi is available on [***]

  • The official Strapi v3 Docker image is available on https://github.com/strapi/strapi-Docker (no longer maintained).

  • The official Docker documentation for Strapi, including example Dockerfiles, is available on [***]

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 strapi 镜像标签

docker pull docker.xuanyuan.run/vshadbolt/strapi:<标签>

使用方法:

  • 登录认证方式
  • 免认证方式

DockerHub 原生拉取命令

docker pull vshadbolt/strapi:<标签>

轩辕镜像配置手册

按平台快速找到配置文档

Docker

登录仓库拉取

登录认证 · 私有仓库

专属域名拉取

免登录 · 高速拉取

Linux

Docker 镜像配置

Windows / Mac

Docker Desktop 配置

MacOS OrbStack

OrbStack 容器

Docker Compose

Compose 项目配置

NAS

群晖

Synology 配置

飞牛

fnOS 镜像配置

绿联

绿联 NAS

威联通

QNAP 配置

极空间

极空间 NAS

企业仓库

其他仓库

ghcr · Quay · nvcr

Harbor 镜像源

Proxy Repository 对接

Portainer 镜像源

Registries 配置

Nexus 镜像源

Docker Proxy 缓存

开发工具

Dev Containers

VS Code 开发容器

Podman

Podman 配置指南

Singularity / Apptainer

HPC 科学计算容器

Kubernetes

K8s Containerd

Kubernetes · Containerd

K3s

轻量级集群

面板 / 网络

爱快路由

iKuai 镜像加速

宝塔面板

一键配置镜像源

AI

用 AI 使用轩辕镜像

agents.md · AI 对话 · 提示词

一键安装

一键安装 Docker

Linux Docker 一键安装

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

功能

免费版与专业版区别

功能对比 · 版本选择

支持的镜像仓库

Docker Hub · GCR · GHCR

新手拉取配置

登录 · 专属域名 · 配置

docker search 限制

专属域名 · Hub 搜索

不支持 push

仅支持 pull · 不支持

拉取速度原因

带宽 · 缓存 · 冷热镜像

错误码

402 与流量用尽

402 · 流量包 · 充值

401 认证失败

401 · docker login

manifest unknown

标签错误 · 镜像不存在

410 Gone 排查

410 · Docker 升级

429 限流

免费版 · 请求频率

其他报错

DNS 超时

DNS 解析 · 网络超时

TLS 证书失败

no matching manifest(架构)

账号

失败是否计费

manifest · blob · 计费

申请开发票(企业 / 个人)

企业 · 个人 · 工单

修改登录密码

网站 · 仓库 · 重置

注销账户

工单 · 数据 · 注销

原理

mirrors 不生效

daemon.json · 重启

去掉域名前缀

docker tag · 重命名

指定架构拉取

ARM64 · AMD64 · 多架构

latest 与「最新」

digest · 版本号 · 标签

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
vshadbolt/strapi
教程轩辕镜像功能与使用教程
定价查看流量套餐与价格
热门查看热门 Docker 镜像推荐
博客Docker 镜像公告与技术博客
专业版 · 高速稳定拉取镜像
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
50GB 仅 ¥7/年
专业版 · 高速稳定拉取镜像
50GB 仅 ¥7/年
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
商务合作:点击复制邮箱
用户协议·隐私政策·©2024-2026 源码跳动
用户协议·隐私政策©2024-2026 杭州源码跳动科技有限公司商务合作:点击复制邮箱

更多 strapi 镜像推荐

elestio/strapi logo

elestio/strapi

elestio
Elestio验证和打包的Strapi镜像,是一个开源、可完全定制且可扩展的JavaScript无头CMS,用于快速创建和管理API,提供及时更新、质量控制和便捷部署。
2 次收藏6.5千+ 次下载
2 年前更新
openg2p/strapi logo

openg2p/strapi

openg2p
暂无描述
65 次下载
6 个月前更新
naskio/strapi logo

naskio/strapi

naskio
用于运行Strapi v4及以上最新版本的Docker镜像,提供无头CMS的便捷部署方案。
31 次收藏50万+ 次下载
7 个月前更新
strapi/hiring-test-api logo

strapi/hiring-test-api

strapi
暂无描述
498 次下载
5 年前更新
strapi/hiring-test-db logo

strapi/hiring-test-db

strapi
暂无描述
473 次下载
6 年前更新
dunadigital/strapi logo

dunadigital/strapi

dunadigital
支持AMD64和ARM64v8架构的Strapi v4 Docker镜像,延续官方项目结构并优化镜像体积,便于快速部署和使用。
6 次收藏5万+ 次下载
1 年前更新

查看更多 strapi 相关镜像

更多相关 Docker 镜像与资源

以下是 vshadbolt/strapi 相关的常用 Docker 镜像,适用于 不同场景 等不同场景:

  • library/ghost Docker 镜像说明(Ghost 专业博客平台,适合内容创作与 Newsletter 发布)
  • library/wordpress Docker 镜像说明(WordPress 内容管理系统,适合博客和网站建设)
  • bitnami/wordpress Docker 镜像说明(WordPress 内容管理系统,Bitnami 企业级配置)