From c063acf67339b6a2acf3e1308dfd29bfd91d2323 Mon Sep 17 00:00:00 2001 From: Alex MacArthur Date: Tue, 3 Sep 2019 15:36:55 -0500 Subject: [PATCH] Add setup for Postgres. --- postgres/README.md | 15 +++++++++++++++ postgres/docker-compose.yml | 9 +++++++++ 2 files changed, 24 insertions(+) create mode 100644 postgres/README.md create mode 100644 postgres/docker-compose.yml diff --git a/postgres/README.md b/postgres/README.md new file mode 100644 index 0000000..358ba0a --- /dev/null +++ b/postgres/README.md @@ -0,0 +1,15 @@ +# Enter the Container w/ Bash + +`docker-compose exec --user root db /bin/bash` + +# Enter the Postgres Shell + +`docker-compose exec --user root db psql -h localhost -U postgres` + +# Create a DB + +While inside the shell, run the following: + +``` +CREATE DATABASE mydatabase; +``` diff --git a/postgres/docker-compose.yml b/postgres/docker-compose.yml new file mode 100644 index 0000000..124496b --- /dev/null +++ b/postgres/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3' + +services: + db: + image: postgres:latest + volumes: + - ./data:/var/lib/postgresql/data + ports: + - 5432:5432