Strapi blog logo
  • Product

      Why Strapi?Content ArchitectureRoadmapIntegrationsTry live demo
      OverviewContent Types BuilderCustomizable APIMedia LibraryRoles & Permissions
      Discover Strapi Enterprise EditionDiscover our partners
  • Pricing

  • Solutions

      Static WebsitesMobile ApplicationsCorporate websitesEditorial SitesEcommerce
      Delivery HeroL'EquipeSociete GeneralePixelDustBanco International
      Discover all our user stories
  • Community

      CommunityWrite for the communityWall of LoveStrapi Conf 2021
      SlackGitHubYoutubeCommunity Forum
      Meet the Strapi Community StarsDiscover the Strapi Showcase
  • Resources

      BlogStartersNewsroomSupport
      Strapi AcademyTutorialsVideosWebinars
      The Guide to Headless CMS Strapi Community Forum
  • Docs

      InstallationConfigurationsDeploymentUpdate versionContent API
      Getting StartedContent ManagerContent-Types BuilderUsers, Roles & PermissionsPluginsSettings
      Developer DocumentationStrapi User Guide

Looking for our logo ?

Logo Brand download
Download Logo Pack
See more Strapi assets
Strapi blog logo
  • Product

    Product

    • Why Strapi?
    • Content Architecture
    • Roadmap
    • Integrations
    • Try live demo

    Features

    • Overview
    • Content Types Builder
    • Customizable API
    • Media Library
    • Roles & Permissions
    • Discover Strapi Enterprise Edition
    • Discover our partners
    Features cover

    Unlock the full potential of content management

    See all features
    Strapi Enterprise Edition

    Discover the advanced features included in Strapi Enterprise Edition.

    Get Started
  • Pricing
  • Solutions

    Solutions

    • Static Websites
    • Mobile Applications
    • Corporate websites
    • Editorial Sites
    • Ecommerce

    Stories

    • Delivery Hero
    • L'Equipe
    • Societe Generale
    • PixelDust
    • Banco International
    • Discover all our user stories
    Delivery Hero team

    Delivery Hero manages their partner portal with Strapi.

    Read their story
    turn 10 studios website

    How 1minus1 delivered a creative website for Turn10 Studios 25% faster with Strapi

    Discover their story
  • Community

    Community

    • Community
    • Write for the community
    • Wall of Love
    • Strapi Conf 2021

    Resources

    • Slack
    • GitHub
    • Youtube
    • Community Forum
    • Meet the Strapi Community Stars
    • Discover the Strapi Showcase
    Strapi Conf

    The first Strapi Global User Conference.

    Register now
    Write for the community

    Contribute on educational content for the community

    Discover the program
  • Resources

    Resources

    • Blog
    • Starters
    • Newsroom
    • Support

    Learning

    • Strapi Academy
    • Tutorials
    • Videos
    • Webinars
    • The Guide to Headless CMS
    • Strapi Community Forum
    Introducing Strapi Academy

    Everything you need to know to master Strapi.

    Go to the academy
    Strapi Repository on GitHub

    Get started with the Strapi repository

    Go to repository
  • Docs

    Developers

    • Installation
    • Configurations
    • Deployment
    • Update version
    • Content API

    User Guide

    • Getting Started
    • Content Manager
    • Content-Types Builder
    • Users, Roles & Permissions
    • Plugins
    • Settings
    • Developer Documentation
    • Strapi User Guide
    Install Strapi

    Install Strapi locally or wherever you need.

    Get Started
    Migration Guides Strapi

    Using a previous version of Strapi? Migrate to the latest.

    Read Guides
Get Started
Back to articles

What is Docker Compose? All you need to know!

What is Docker Compose article cover
  • Share on facebook
  • Share on linkedin
  • Share on twitter
  • Share by email
Victor Coisne

Victor Coisne

December 3, 2020

Docker is known for its use of OS-level virtualization and for the container system it employs to make creating, deploying, and running applications much easier for developers. These small execution environments have the merit of being very lightweight and to run in isolation from one another while still sharing the same operating system kernel. Docker puts several tools at the disposal of developers to help them create containerized applications, including Dockerfile, Docker image, Docker run, Docker Hub, Docker Engine, and more. It also provides solutions to streamline behaviors between containers and makes it possible to hitch them together to create application stacks. But what is Docker Compose? Essentially, it was designed to simplify multi-container application development and testing.

What Is Docker Compose?

Docker Compose is a command-line tool that uses a specially formatted descriptor file to take multiple containers and assemble them into applications which can then be run on a single host. The application’s services are configured using YAML files. Maybe you wonder what is Docker Compose main benefit? Most certainly the fact that it allows users to run commands on several containers at the same time. This means that developers can write a YAML configuration file for their application service and subsequently use just one command to start it. Originally developed for Linux, this tool is now available to most operating systems, including Windows and macOS.

docker-compose-button

Why Use Docker Compose?

What is Docker Compose used for, concretely, and what makes it so popular?

One of the main benefits of Docker Compose is its huge portability. The command docker-compose up alone is enough to bring up a whole development environment, which can then be torn down by utilizing docker-compose down. This means developers can centralize their development environments and deploy applications effortlessly. Testing, in the form of unit and E2E tests, is one of Docker Compose’s other main features. It allows for convenient and repeatable testing without mandating a change in the environment. It makes it possible to run an environment very similar to the production circumstances instead of having to test the application on a local or host operating system. Docker Compose can accommodate several isolated environments on one single host, allowing developers to rely on the same machine to run multiple copies of a given environment. Using Docker Compose also means they do not need to take the risk of having different services and projects interfere with one another.

CTT - Docker Compose

What is Docker Compose’s most common use-case scenario?

Docker Compose could be considered a workflow improvement tool. As previously stated, it simplifies testing processes by making it possible to use any machine with Docker installed to run applications in an isolated environment. Yet, it now supports deployment and can be used to manage the rolling out of several containers on a host system.

How to Use Docker Compose?

With a single command, Docker Compose allows a developer to bring up a project together with all the services it requires to run smoothly. For instance, it could be used to install a headless CMS such as Strapi. To that end, both Docker and Docker Compose need to be installed on the Mac, Windows, or Linux machine you wish to use. There is a very helpful tutorial on how to install Strapi using Docker available from Strapi itself, which involves creating a ‘docker-compose.yaml’ file and pulling images before running the stack. Once these steps are done, you can start using your containers, keeping in mind that any computer deleted will result in the loss of the corresponding data. To prevent this, establishing data persistence is possible thanks to user-defined volumes.

What is Docker Compose achieving by running Strapi?

It provides an isolated environment where projects can be experimented with. You can have as many containers as you like and swap them around to arrange them into a network. By default, a single network will be created for each container, ensuring complete isolation. With that said, more complex topologies can be configured wherever necessary using a top-level network key. If you wish to experiment before trying your hand at your own project, you will find source code to study on Github, whether you want to start from scratch or use Docker Compose for a pre-existing project.

In answer to the question: ‘What is Docker Compose?’, one could argue that it is one of the most conclusive alternatives to the complicated task that building, running and connecting dockerfiles can represent when dealing with multiple containers. Federating all their containers under a single command is a dream come true for many developers, especially when they want to run several applications inside said containers. Machine-optimized and human-readable at the same time, the YAML rules declared within Docker Compose’s configuration file provide a compelling solution to turn the countless code lines of a project into one digestible snapshot.

Subscribe to Newsletter

Do you want to use Docker and Docker Compose to deploy Strapi to your favorite cloud? Check out this tutorial on how to run a Strapi dev stack on with Docker Compose?

  • Share on facebook
  • Share on linkedin
  • Share on twitter
  • Share by email

You might also be interested in...

How to run a Strapi dev stack with Docker compose
  • Guides & Tutorials

How to run a Strapi dev stack with Docker compose

Victor Kane, a member of the Strapi community shows you how to run a Strapi dev stack with Docker compose

Victor Kane

Victor Kane

April 14, 2020

Analyzing data from a Strapi API with Python
  • Guides & Tutorials

Analyzing data from a Strapi API with Python

Integrate Strapi with Python to analyze the data of your headless cms. Use tools like pandas to work with your Strapi data.

Cretu Razvan

December 1, 2020

Building a Jamstack Food Ordering App with Strapi, Gridsome & Snipcart 1/6
  • Guides & Tutorials

Building a Jamstack Food Ordering App with Strapi, Gridsome & Snipcart 1/6

Learn how to create a food ordering app with Gridsome, Snipcart and your favorite headless CMS: Strapi

Ekene Eze

Ekene Eze

December 7, 2020

Newsletter

Sign up for the Strapi newsletter to keep up with the latest news from the Strapi community!

Unleash content.

Starters
Get Started

Strapi is the leading open-source Headless CMS. Strapi gives developers the freedom to use their favorite tools and frameworks while allowing editors to easily manage their content and distribute it anywhere.

Product

  • Why Strapi?
  • Content Architecture
  • Features
  • Enterprise Edition
  • Partner Program
  • Roadmap
  • Support
  • Try live demo
  • Changelog

Resources

  • How to get started
  • Meet the community
  • Tutorials
  • API documentation
  • GitHub repository
  • Starters
  • Strapi vs Wordpress
  • The Guide to headless CMS

Integrations

  • All integrations
  • React CMS
  • Next.js CMS
  • Gatsby CMS
  • Vue.js CMS
  • Nuxt.js CMS
  • Gridsome CMS
  • Flutter CMS
  • Hugo CMS
  • Typescript CMS

Company

  • About us
  • Blog
  • Careers
  • Contact
  • Newsroom
  • © 2021, Strapi
  • LicenseTermsPrivacy