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