Docker Compose 101

Introduction

  • myservice_1 — its some JVM application that uses 2g of memory and needs to communicate with redis (using tcp) and myservice_2 (using http).
  • we want to share a storage volume across all three of the containers.
services:
agent:
image: "myservice_1"
command: ["--cache", "cache:6379", "--backend_http", "http://backend_service:4000" ]
environment:
JAVA_OPTS: -Xmx2g
volumes:
- /tmp/disk:/data
ports:
- 49100:22
cache:
image: "redis"
volumes:
- /tmp/disk:/data
expose:
- "6379"
backend_service:
image: "myservice_2"
command: ["--http_port", "4000" ]
volumes:
- /tmp/disk:/data
expose:
- "4000"

--

--

--

Listener and reader

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

What is a variable? Primitive and Reference data types ))

Hacking with scala spray-json

Wanna Know How To Make $$$$$$ Before & After Black Friday…. In Under Seven Minutes???

The Art of Agile

7 Golang Features You Might Find Weird

How to install PostgreSQL on CentOS 8

How to install PostgreSQL on CentOS 8

DungeonSwap 3rd development log and updated timeline

Our Agile Project Process — hmm? yet another & my problem

Clarksons’s Farm on Amazon Prime

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Programmer

Programmer

Listener and reader

More from Medium

How to debug Flask (running in docker-compose) in VS Code

Failure-Tolerant Queue in Django and PostgreSQL

Drawing of a man riding an elephant

Setup Docker though WSL on Windows

How to build AdonisJS API to store your Raspberry Pi Temperature