Skip to content

Instantly share code, notes, and snippets.

@lukeandersen
Last active March 14, 2019 12:18
Show Gist options
  • Select an option

  • Save lukeandersen/9c55e5e3a46914b8064980748987325e to your computer and use it in GitHub Desktop.

Select an option

Save lukeandersen/9c55e5e3a46914b8064980748987325e to your computer and use it in GitHub Desktop.
Basic docker compose for a local Node and Mongo app
version: "3"
services:
app:
container_name: this-app
restart: always
build: ../path-to-this-app/
volumes:
- .:/src/app
- /src/app/node_modules
ports:
- "3001:3001"
links:
- mongo
environment:
WAIT_HOSTS: mongo:27017
mongo:
container_name: mongo
image: mongo
volumes:
- ./data:/data/db
ports:
- "27017:27017"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment