Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

Build Services with Docker Compose

For the last six months, the Acme Anvil Corporation has been migrating some of their bare metal infrastructure to Docker containers. Your team wants to find an easier way to deploy applications that consist of multiple containers and has decided to use Docker Compose. You have been tasked with setting up an internal blog so the team can write technical articles. This blog will consist of two services: a Ghost Blog service and a MySQL service. Both services will use volumes for persistent storage.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 1h 30m
Published
Clock icon Nov 07, 2018

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Create a Ghost Blog and MySQL Service

    1. Create a docker-compose.yml file in the root directory.

      vi docker-compose.yml
      
    2. Add the following contents to it:

      version: '3'
      services:
        ghost:
          image: ghost:1-alpine
          container_name: ghost-blog
          restart: always
          ports:
            - 80:2368
          environment:
            database__client: mysql
            database__connection__host: mysql
            database__connection__user: root
            database__connection__password: P4sSw0rd0!
            database__connection__database: ghost
          volumes:
            - ghost-volume:/var/lib/ghost
          depends_on:
            - mysql
      
        mysql:
          image: mysql:5.7
          container_name: ghost-db
          restart: always
          environment:
            MYSQL_ROOT_PASSWORD: P4sSw0rd0!
          volumes:
            - mysql-volume:/var/lib/mysql
      
      volumes:  
        ghost-volume:  
        mysql-volume:  
      
  2. Challenge

    Bring Up the Ghost Blog Service

    1. Start up the Docker Compose service.
      docker-compose up -d
      

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans