Skip to content

Instantly share code, notes, and snippets.

@hexsprite
Created September 27, 2016 19:25
Show Gist options
  • Select an option

  • Save hexsprite/cffe355502c36443e11b05f60f7b4afc to your computer and use it in GitHub Desktop.

Select an option

Save hexsprite/cffe355502c36443e11b05f60f7b4afc to your computer and use it in GitHub Desktop.
# Example Docker Cloud Stackfile
# app
app:
image: 'jshimko/todos:latest'
environment:
- 'MONGO_URL=mongodb://appUser:appUserPass@mongo1:27017,mongo2:27017/dbName?replicaSet=repSetName'
- 'MONGO_OPLOG_URL=mongodb://appUser:appUserPass@mongo1:27017,mongo2:27017/local?authSource=dbName'
- 'ROOT_URL=http://example.com'
links:
- mongo1
- mongo2
ports:
- '80:80'
tags:
- app
# mongo primary
mongo1:
image: 'jshimko/mongo-rep-set:latest'
environment:
- MONGO_APP_DATABASE=dbName
- MONGO_APP_PASSWORD=appUserPass
- MONGO_APP_USER=appUser
- MONGO_ARBITER=mongo3
- MONGO_DB_PATH=/data/dbName
- MONGO_ROLE=primary
- MONGO_ROOT_PASSWORD=rootUserPass
- MONGO_ROOT_USER=rootUserName
- MONGO_SECONDARY=mongo2
- REP_SET=repSetName
links:
- mongo2
- mongo3
tags:
- mongo1
# mongo secondary
mongo2:
image: 'jshimko/mongo-rep-set:latest'
environment:
- MONGO_DB_PATH=/data/dbName
- REP_SET=repSetName
tags:
- mongo2
# arbiter
mongo3:
image: 'jshimko/mongo-rep-set:latest'
environment:
- JOURNALING=false
- REP_SET=repSetName
tags:
- app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment