August 2018
Intermediate to advanced
416 pages
12h 37m
English
Tools such as Docker and Kubernetes have risen in popularity because of their ability to isolate environment-level information and to create reproducible/repeatable environments. Using Docker, you can declare all of your external services, such as Redis and MongoDB.
Here is an example of docker-compose YML script for the API workshop repo (https://github.com/jbelmont/api-workshop):
version: '3'
services:
mongo:
image: mongo:3.4.5
command: --smallfiles --quiet --logpath=/dev/null --dbpath=/data/db
ports:
- "27017:27017"
volumes:
- data:/data/db
redis:
image: redis:3.2-alpine
ports:
- "6379:6379"
apid:
build: context: . dockerfile: Dockerfile-go depends_on: - mongo - redis env_file: - ./common.env links: - mongo ...Read now
Unlock full access