Skip to content

Commit

Permalink
update readme, add script for docker db, add data dir to gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
lfuelling committed Jun 8, 2018
1 parent 306dafc commit 88e2393
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ npm-debug.log
*.txt
*.dat
/archived/
/data/
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Development dependencies:
* TimescaleDB PostgreSQL extension
* Node.JS, NPM

You can create a timescaledb instance using the `startDevDB.sh` script. (this requires docker and you need to change the `DATA_DIR` variable in the script)

## Development setup

Configure `config/dev.exs` if you need another db/user than `fd_dev` and `postgres`.
Expand All @@ -20,9 +22,9 @@ Checkout dependencies

Create the database

mix ecto.migrate
mix ecto.create

If your postgresql user is not a superuser, you will need to create the database manually and load the extensions:
(Not needed for the docker iamge) If your postgresql user is not a superuser, you will need to create the database manually and load the extensions:

psql -d fd_database
create extension timescaledb;
Expand Down
6 changes: 6 additions & 0 deletions startDevDB.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -euo pipefail

DATA_DIR=/Users/lerk/workspace/fediverse-network/data

docker run -d --name timescaledb -v $DATA_DIR:/var/lib/postgresql/data -e POSTGRES_PASSWORD=postgres -p 5432:5432 timescale/timescaledb:latest-pg9.6

0 comments on commit 88e2393

Please sign in to comment.