From 88e239365f7af180fdde351675895fe3eee495c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20F=C3=BClling?= Date: Fri, 8 Jun 2018 10:10:13 +0200 Subject: [PATCH] update readme, add script for docker db, add data dir to gitignore --- .gitignore | 1 + README.md | 6 ++++-- startDevDB.sh | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100755 startDevDB.sh diff --git a/.gitignore b/.gitignore index c19f8cf..650ab35 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ npm-debug.log *.txt *.dat /archived/ +/data/ diff --git a/README.md b/README.md index 7020dd0..6d0f8d8 100644 --- a/README.md +++ b/README.md @@ -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`. @@ -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; diff --git a/startDevDB.sh b/startDevDB.sh new file mode 100755 index 0000000..6fe67d2 --- /dev/null +++ b/startDevDB.sh @@ -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