All Projects → strapi → Strapi Docker

strapi / Strapi Docker

Licence: mit
Install and run your first Strapi project using Docker

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Strapi Docker

Build Blockchain Insurance App
Sample insurance application using Hyperledger Fabric
Stars: ✭ 609 (-25.55%)
Mutual labels:  docker-compose
Orats
Opinionated rails application templates.
Stars: ✭ 681 (-16.75%)
Mutual labels:  docker-compose
Dip
CLI gives the "native" interaction with applications configured with Docker Compose.
Stars: ✭ 737 (-9.9%)
Mutual labels:  docker-compose
New Bee
开源社区 vue + springBoot - 前后分离微服务的最佳实践
Stars: ✭ 619 (-24.33%)
Mutual labels:  docker-compose
Filterlists
🛡 The independent, comprehensive directory of filter and host lists for advertisements, trackers, malware, and annoyances.
Stars: ✭ 653 (-20.17%)
Mutual labels:  docker-compose
Laravel Boilerplate
Laravel Boilerplate / Starter Kit with Gentelella Admin Theme
Stars: ✭ 704 (-13.94%)
Mutual labels:  docker-compose
Docker Compose Elasticsearch Kibana
Docker Compose for Elasticsearch and Kibana
Stars: ✭ 584 (-28.61%)
Mutual labels:  docker-compose
Docker Compose Files
Some typical docker compose templates.
Stars: ✭ 795 (-2.81%)
Mutual labels:  docker-compose
Docker Handbook Projects
Project codes used in "The Docker Handbook"
Stars: ✭ 661 (-19.19%)
Mutual labels:  docker-compose
Nodock
Docker Compose for Node projects with Node, MySQL, Redis, MongoDB, NGINX, Apache2, Memcached, Certbot and RabbitMQ images
Stars: ✭ 734 (-10.27%)
Mutual labels:  docker-compose
Clean Ts Api
API em NodeJs usando Typescript, TDD, Clean Architecture, Design Patterns e SOLID principles
Stars: ✭ 619 (-24.33%)
Mutual labels:  docker-compose
Netbox Docker
🐳 Docker Image of NetBox
Stars: ✭ 628 (-23.23%)
Mutual labels:  docker-compose
Pitstop
This repo contains a sample application based on a Garage Management System for Pitstop - a fictitious garage. The primary goal of this sample is to demonstrate several software-architecture concepts like: Microservices, CQRS, Event Sourcing, Domain Driven Design (DDD), Eventual Consistency.
Stars: ✭ 708 (-13.45%)
Mutual labels:  docker-compose
Docker4wordpress
Docker-based WordPress stack
Stars: ✭ 607 (-25.79%)
Mutual labels:  docker-compose
Kompose
Go from Docker Compose to Kubernetes
Stars: ✭ 7,348 (+798.29%)
Mutual labels:  docker-compose
Vue Blog
A single-user blog built with vue2, koa2 and mongodb which supports Server-Side Rendering
Stars: ✭ 586 (-28.36%)
Mutual labels:  docker-compose
Bobarr
🍿 The all-in-one alternative for Sonarr, Radarr, Jackett... with a VPN and running in docker
Stars: ✭ 697 (-14.79%)
Mutual labels:  docker-compose
Aria2 Pro Docker
Aria2 Pro | A perfect Aria2 Docker image | 更好用的 Aria2 Docker 容器镜像
Stars: ✭ 802 (-1.96%)
Mutual labels:  docker-compose
Docker Host
A docker sidecar container to forward all traffic to local docker host or any other host
Stars: ✭ 769 (-5.99%)
Mutual labels:  docker-compose
Vue Koa Demo
🔰A simple full stack demo(CSR & SSR & Docker Support) written by Vue2 & Koa2(Koa1 verson also completed)
Stars: ✭ 730 (-10.76%)
Mutual labels:  docker-compose

Strapi containerized

Strapi

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


Travis Docker Pulls

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:

docker run -it \
  -e DATABASE_CLIENT=postgres \
  -e DATABASE_NAME=strapi \
  -e DATABASE_HOST=0.0.0.0 \
  -e DATABASE_PORT=5432 \
  -e DATABASE_USERNAME=strapi \
  -e DATABASE_PASSWORD=strapi \
  -p 1337:1337 \
  -v `pwd`/project-name:/srv/app \
  strapi/strapi

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:

docker run -it \
  -e DATABASE_NAME=strapi \
  -e DATABASE_HOST=0.0.0.0 \
  -e DATABASE_PORT=1234 \
  -e DATABASE_USERNAME=strapi \
  -e DATABASE_PASSWORD=strapi \
  -p 1337:1337 \
  -v `pwd`/project-name:/srv/app \
  strapi/strapi

Upgrading Strapi in Docker container

  • 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:

yarn install
./bin/build.js --help
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].