Skip to content

Latest commit

 

History

History
52 lines (41 loc) · 1.19 KB

README.md

File metadata and controls

52 lines (41 loc) · 1.19 KB

Example 6

< Go Back

Compose a data analytics app

Docker compose lets us define a deploy a multi-container app very easily.

Define the application

Complete the docker-compose.yaml configuration file:

  • Link the mysql service container to the jupyter service container;
  • Mount the data volume workshop-docker-mysqldata to the mount-point /var/lib/mysql.
version: '3'

# Containers to be instantiated in environment
services:
  jupyter:
    image: workshop-docker/example4
    ports:
      - "8888:8888"
    volumes:
      - ./notebooks:/tmp/notebooks
    links:
      - <mysql-container-service-name>
  mysql:
    image: mysql/mysql-server
    volumes:
      - <data-volume>:<mount-point>

# External volumes for the declared services
volumes:
  workshop-docker-mysqldata:
    external:
      name: workshop-docker-mysqldata

Run the application

Now that you've done all the hard work of defining images and containers, running everything is easy!

$ docker-compose up

Cleaning up

Shutting the application down is equally easy:

$ docker-compose down

< Go Back | Solution