Skip to content

Instantly share code, notes, and snippets.

@oosidat
Created August 15, 2017 02:00
Show Gist options
  • Save oosidat/646a285c8a375d937baa0933edcc475e to your computer and use it in GitHub Desktop.
Save oosidat/646a285c8a375d937baa0933edcc475e to your computer and use it in GitHub Desktop.
Simple docker-compose for starting up mongo, redis and postgres in docker...
mongo:
image: mongo:3.2.11
volumes:
- /data/db/mongo
ports:
- "27017:27017"
redis:
image: redis
volumes:
- /data/db/redis
ports:
- "6379:6379"
postgres:
image: postgres
ports:
- "5432:5432"
environment:
POSTGRES_USER: mydbname
PGDATA: /data/db/postgres
@oosidat
Copy link
Author

oosidat commented Aug 15, 2017

if the environment variable POSTGRES_USER is not specified, a default db will be setup.

Also, on MacOS, psql might not work properly:

$ psql
psql: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

However, specifying the host, user and db worked:

$ psql -h localhost mydbname mydbname
psql (9.6.4)
Type "help" for help.

mydbname =# 

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