This is Docker container for Strapi (v4)
Using Docker Compose, create docker-compose.yml
file with the following content:
You can find more example on GitHub.
version: "3.9"
services:
strapi:
image: osama144/strapi:latest # or ghcr.io/osama-altamimi/strapi:latest
container_name: Strapi
restart: on-failure:5
ports:
- 1337:1337
environment:
NODE_ENV: development # or production
This image allows you to create a new Strapi project.
- for
NODE_ENV = development
: The command that will run in your project isstrapi develop
. - for
NODE_ENV = production
: The command that will run in your project isstrapi start
.
The Content-Type Builder plugin is disabled WHEN
NODE_ENV = production
.
Environment Variables
-
NODE_ENV
The command that will run in your project. | Default >development
-
DATABASE_CLIENT
The database client to use, supported by Strapi: (sqlite, postgres, mysql). | Default >sqlite
-
DATABASE_HOST
The database host. -
DATABASE_PORT
The database port. -
DATABASE_NAME
The database name. -
DATABASE_USERNAME
The database username. -
DATABASE_PASSWORD
The database password. -
DATABASE_SSL
Boolean for SSL. | Default >false
App Keys (Optional) - You set it up when you created the container.
If you would like to change these variables for the keys.
-
APP_KEYS = "key1,key2,key3,key4"
It is preferable to place four random keys, preferably consisting of 24 numbers and letters. -
ADMIN_JWT_SECRET = "key"
It is preferred to include 24 random numbers and letters. -
API_TOKEN_SALT = "key"
It is preferred to include 24 random numbers and letters. -
TRANSFER_TOKEN_SALT = "key"
It is preferred to include 24 random numbers and letters. -
JWT_SECRET = "key"
It is preferred to include 32 random numbers and letters.
- Resource center - Strapi resource center.
- Strapi documentation - Official Strapi documentation.
- Strapi tutorials - List of tutorials made by the core team and the community.
This project is a personal effort and is not affiliated with any company โค๏ธ.