Skip to content

Instantly share code, notes, and snippets.

@calebcauthon
Last active May 17, 2018 00:32
Show Gist options
  • Save calebcauthon/3cca1e42da1040cdad16789ec24cd737 to your computer and use it in GitHub Desktop.
Save calebcauthon/3cca1e42da1040cdad16789ec24cd737 to your computer and use it in GitHub Desktop.
Run a Postgres Instance using Docker
<HOST>:5432:*:<USERNAME>:<PASSWORD>
<HOST>:5432:*:<USERNAME>:<PASSWORD>

  1. Save stack.yml to your computer
  2. Copy & paste start_docker.sh into your command line to start a postgres instance
  3. Set up a .pgpass file with 2 lines. One for the RDS instance and one for your local postgres instance. Put the file in your home directory
  4. Copy & paste load_data.sh into your command line, to load data to your local instance. This may take 30 minutes.
  5. Now you can use your docker machine's IP address at port 5432 as a hestia instance
pg_dump -h <rds_host_full_uri e.g., something.amazon.com> -U ops -C prod | psql -h <your docker machine IP e.g., 192.168.99.100> -U postgres postgres
# Use postgres/example user/password credentials
version: '3.1'
services:
db:
image: postgres
environment:
POSTGRES_PASSWORD: example
ports:
- 5432:5432
docker stack deploy -c stack.yml
@creekfish
Copy link

docker stack deploy -c stack.yml is not working for me, ```"docker stack deploy" requires exactly 1 argument(s).
See 'docker stack deploy --help'.

Usage: docker stack deploy [OPTIONS] STACK

Deploy a new stack or update an existing stack``` Help?

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