Skip to content

Instantly share code, notes, and snippets.

@mwmahlberg
Created December 15, 2018 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwmahlberg/c92936555bfa92191c25cf6972257726 to your computer and use it in GitHub Desktop.
Save mwmahlberg/c92936555bfa92191c25cf6972257726 to your computer and use it in GitHub Desktop.
  • No need for a dedicated network: docker compose autmatically sets one up for you
  • No need to export MongoDB's port: you can access it via docker exec -it test_mongodb_1 mongo
version: "3"
services:
mongodb:
image: mongo
volumes:
- mongodata:/data/db
microservice:
depends_on:
- mongodb
build: .
image: cloud-native-go:v1
environment:
- PORT=9090
ports:
- 9090:9090
volumes:
mongodata:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment