Được TopGit lập chỉ mục từ metadata GitHub: strapi/strapi-docker có 1.2k sao, viết chủ yếu bằng JavaScript. Install and run your first Strapi project using Docker
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
⚠️ This image is only for Strapi v3. For now, we will not update it for v4.
However, to build an image compatible with Strapi v4, we recommend you check out this tool created by the Strapi Community: https://github.com/strapi-community/strapi-tool-dockerize
API creation made simple, secure and fast.
The most advanced open-source Content Management Framework to build powerful API with no effort.
Images
Strapi comes with two images: strapi/strapi and strapi/base.
Use strapi/strapi to create a new project or run a project on your host machine.
Use strapi/base to build a Dockerfile and create an image for your app.
How to use strapi/strapi
This image allows you to create a new strapi project or run a project from your host machine. The default command that will run in your project is strapi develop.
Creating a new project
When running this image, strapi will check if there is a project in the /srv/app folder of the container. If there is nothing then it will run the strapi new command in the container /srv/app folder. You can create a new project by running this command.
docker run -it -p 1337:1337 -v `pwd`/project-name:/srv/app strapi/strapi
This command creates a project with an SQLite database. Then starts it on port 1337.
The -v option creates a project-name folder on your computer that will be shared with the docker container.
Once the project is created it will be available in this folder on your computer.
Environment variables
When creating a new project with this image you can pass database configurations to the strapi new command.
DATABASE_CLIENT a database provider supported by Strapi: (sqlite, postgres, mysql ,mongo).
DATABASE_HOST database host.
DATABASE_PORT database port.
DATABASE_NAME database name.
DATABASE_USERNAME database username.
DATABASE_PASSWORD database password.
DATABASE_SSL boolean for SSL.
EXTRA_ARGS pass extra args to the strapi new.
Example
You can create a strapi project that will connect to a remote postgres database like so:
You can also create projects using docker-compose. See examples of using these variables with docker-compose in the examples folder.
Running a project from your host machine
You can also use strapi/strapi to run a project you already have created (or cloned for a repo) on your computer.
First make sure to delete the node_modules folder if you have already installed your dependencies on your host machine. Then run:
cd my-project
docker run -it -p 1337:1337 -v `pwd`:/srv/app strapi/strapi
This will start by installing the dependencies and then run strapi develop in the project.
Environment variables
If you are using environment variables in your code you can pass them with the -e option (e.g docker run -e ENV_VAR=sth ...).
You can for example set your database configuration with environment variables.
Because the default container command is strapi develop you will need to update your development database configuration following the production example in the documentation. Then you can run:
Important! Upgrading strapi/strapi Docker image tag does not upgrade Strapi version.
Strapi NodeJS application builds itself during first startup only, if detects empty folder and is normally stored in mounted volume. See docker-entrypoint.sh.
To upgrade, first follow the guides (general and version-specific) to rebuild actual Strapi NodeJS application. Secondly, update docker tag to match the version to avoid confusion.
How to use strapi/base
When deploying a strapi application to production you can use docker to package your whole app in an image. You can create a Dockerfile in your strapi project like the one in ./examples/custom
Building the images in this repository
You can build the images with the build command. To see the options run:
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/strapi/strapi-docker là nguồn chính thức.
strapi/strapi-docker có bao nhiêu sao?
strapi/strapi-docker có 1.2k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/strapi/strapi-docker. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
strapi/strapi-docker có phải mã nguồn mở không?
Có — strapi/strapi-docker phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/strapi/strapi-docker.
strapi/strapi-docker còn đang phát triển không?
Commit gần nhất trên strapi/strapi-docker là 2.1 năm trước (theo timestamp GitHub). Repo có 431 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
strapi/strapi-docker là gì?
strapi/strapi-docker (strapi/strapi-docker) là dự án JavaScript trên GitHub. Theo mô tả gốc: Install and run your first Strapi project using Docker
strapi/strapi-docker so với các dự án Developer Tools khác thế nào?
strapi/strapi-docker được TopGit xếp vào nhóm Developer Tools, với 1.2k sao GitHub và viết bằng JavaScript. Xem trang chủ đề Developer Tools trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
strapi-docker có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về strapi-docker.