Skip to content

Instantly share code, notes, and snippets.

@kpettijohn
Last active August 29, 2015 14:27
Show Gist options
  • Save kpettijohn/b20a572cf0b1ee9be27c to your computer and use it in GitHub Desktop.
Save kpettijohn/b20a572cf0b1ee9be27c to your computer and use it in GitHub Desktop.
Docker Compose
redis:
image: redis
ports:
- "6379:6379"
# Create the koop databause with the following command:
# docker exec b5c14ac0d764 psql -U postgres -c "CREATE DATABASE koop TEMPLATE template_postgis;"
postgis:
image: kpettijohn/postgis:9.3
ports:
- "5432:5432"

Within your working directory create a docker-compose.yml.

Start all containers in the background. docker-compose up -d

Creating test_redis_1...
Creating test_postgis_1...

List your containers controlled by docker-compose. docker-compose ps

     Name                   Command               State           Ports
--------------------------------------------------------------------------------
test_postgis_1   /docker-entrypoint.sh postgres   Up      0.0.0.0:5432->5432/tcp
test_redis_1     /entrypoint.sh redis-server      Up      0.0.0.0:6379->6379/tcp

Create a database on test_postgis_1 using the docker exec command. docker exec test_postgis_1 psql -U postgres -c "CREATE DATABASE koop TEMPLATE template_postgis;"

CREATE DATABASE

Point your config files for koop to docker-machine ip dev.

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