Strapi containerized
API creation made simple, secure and fast. The most advanced open-source Content Management Framework to build powerful API with no effort.
git clone https://github.com/strapi/strapi-docker && cd strapi-docker
- Run using
docker-compose up
docker pull strapi/strapi
Start a database (e.g. MongoDB)
docker run -e MONGO_INITDB_DATABASE=strapi \
-v `pwd`/db/:/data/db \
--name strapi-mongo \
-d mongo
Start strapi
docker run -e APP_NAME=strapi-app \
-e DATABASE_CLIENT=mongo \
-e DATABASE_HOST=strapi-mongo \
-e DATABASE_PORT=27017 \
-e DATABASE_NAME=strapi \
-v `pwd`/strapi-app:/usr/src/api/strapi-app \
--link strapi-mongo:mongo \
-p 1337:1337 \
--name strapi -d strapi/strapi
You should the be able to access your Strapi installation at localhost:1337.
FROM strapi/strapi
APP_NAME
to override thestrapi-app
generated folder name (you should also update the volumes paths).DATABASE_CLIENT
a database providers supported by Strapi: MongoDB, Postgres, MySQL, Sqlite3 and Redis.DATABASE_HOST
database service name.DATABASE_PORT
depends on your database client.DATABASE_NAME
initializes a database with specific name (default strapi). When using MongoDB, you should also update theMONGO_INITDB_DATABASE
environment in the db service.DATABASE_USERNAME
set the username of the database connection.DATABASE_PASSWORD
set the password of the database connection.DATABASE_SSL
boolean for SSL.DATABASE_AUTHENTICATION_DATABASE
set the authentification.