Skip to content

Instantly share code, notes, and snippets.

@rjswenson
Last active June 23, 2017 14:54
Show Gist options
  • Save rjswenson/47b079f729cc949c3aa53b0899fd05c3 to your computer and use it in GitHub Desktop.
Save rjswenson/47b079f729cc949c3aa53b0899fd05c3 to your computer and use it in GitHub Desktop.
Linux/Debian Dev setup with Docker and services (mongodb / redis / elasticsearch)
sudo apt-get install docker
mkdir -p /mongodb/data
docker run --name mongo -p 27017:27017 -d -v /mongodb:/data mongo:latest bash -c 'mongod --logpath /data/mongodb.log --logappend --dbpath /data/data --storageEngine=wiredTiger'
mkdir -p /redis
docker run --name redis -p 6379:6379 -d -v /redis:/data redis:3.0.7 bash -c 'redis-server --dir /data --appendonly yes'
mkdir /elastic
docker run --name elastic --user elasticsearch -p 9200:9200 -p 9300:9300 -d -v /elastic:/data elasticsearch:1.4.5 bash -c 'elasticsearch --cluster.name elastic_cluster --node.name elastic01 --path.data /data/elastic-data --path.logs /data/elastic-logs'
docker run --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=postgres -v /postgres:/var/lib/postgresql/data -d postgres
# `docker rm <name>`
# `docker ps` should list all 3 services. If not, rm then run them with the -it(interactive) command instead of -d (daemon)
@rjswenson
Copy link
Author

[12:46 PM] Charles Jones:
pweb () {
docker ps --format "{{.Names}}\t{{.Ports}}" | grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn} 'web' | sed 's/0.0.0.0:([0-9])/http://localhost:\1/scramble//' | sed 's/->.//'
}

[12:47 PM] Charles Jones:
pweb () {
docker ps --format "{{.Names}}\t{{.Ports}}" | grep 'web' | sed 's/0.0.0.0:([0-9])/http://localhost:\1/scramble//' | sed 's/->.//'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment