Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added note for fixing PostgreSQL issue #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,17 @@ To try out (you will need Docker installed):
```bash
git clone https://github.com/brokenhandsio/SteamPressExample.git
cd SteamPressExample
./setupDB.sh
./bin/setupDB.sh
swift run
```

This will create a site at http://localhost:8080. The blog can be found at http://localhost:8080/blog/ and you can login at http://localhost:8080/blog/admin/. The first time you visit the login a user will be created and the details printed to the console.

**Note**: If you receive an error such as "Thread 1: Fatal error: Error raised at top level...", then it is likely you are already running an instance of PostgreSQL on your machine. To try and resolve:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be due to a number of errors, such as something already running on port 8080 so we probably need to quality this better


```
./bin/stopDB.sh # will stop your existing docker instance if running
lsof -i :5432 # will show you existing processes running postgres
brew services stop postgresql # will stop postgresql if homebrew is running it
./bin/setupDB.sh # restarts db for this example
```
1 change: 1 addition & 0 deletions resetDB.sh → bin/resetDB.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#!/bin/bash
docker stop steampress && docker rm steampress && sh setupDB.sh
1 change: 1 addition & 0 deletions setupDB.sh → bin/setupDB.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#!/bin/bash
docker run --name steampress -e POSTGRES_DB=steampress -e POSTGRES_USER=steampress -e POSTGRES_PASSWORD=password -p 5432:5432 -d postgres
1 change: 1 addition & 0 deletions setupTestDB.sh → bin/setupTestDB.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#!/bin/bash
docker run --name steampress-test -e POSTGRES_DB=steampress-test -e POSTGRES_USER=steampress -e POSTGRES_PASSWORD=password -p 5433:5432 -d postgres
3 changes: 3 additions & 0 deletions bin/stopDB.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
containerID=$(docker ps -q -f "name=steampress")
docker rm -f $containerID