Skip to content

Instantly share code, notes, and snippets.

@chartjes
Created January 6, 2016 15:20
Show Gist options
  • Save chartjes/9d215cbe6319965d7a97 to your computer and use it in GitHub Desktop.
Save chartjes/9d215cbe6319965d7a97 to your computer and use it in GitHub Desktop.
Here is my scenario:
* using docker-compose to spin up 4 containers: master, read-only, db1, db2
* all four containers are succesfully spun up
* once all the containers are up and running, I need to run the same two commands on master and read-only, one after the other
I have no idea how I can automate this and I prefer to NOT have folks manually do 'docker run blah blah blah'
Here is my current Docker compose file
db1:
image: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
db2:
image: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
master:
image: chartjes/kinto-master
links:
- db1
ports:
- "8888:8888"
environment:
KINTO_CACHE_BACKEND: cliquet.cache.postgresql
KINTO_CACHE_URL: postgres://postgres:postgres@db1/postgres
KINTO_STORAGE_BACKEND: cliquet.storage.postgresql
KINTO_STORAGE_URL: postgres://postgres:postgres@db1/postgres
KINTO_PERMISSION_BACKEND: cliquet.permission.postgresql
KINTO_PERMISSION_URL: postgres://postgres:postgres@db1/postgres
read-only:
image: chartjes/kinto-read-only
links:
- db2
ports:
- "8889:8889"
environment:
KINTO_CACHE_BACKEND: cliquet.cache.postgresql
KINTO_CACHE_URL: postgres://postgres:postgres@db2/postgres
KINTO_STORAGE_BACKEND: cliquet.storage.postgresql
KINTO_STORAGE_URL: postgres://postgres:postgres@db2/postgres
KINTO_PERMISSION_BACKEND: cliquet.permission.postgresql
KINTO_PERMISSION_URL: postgres://postgres:postgres@db2/postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment