From 449ebe5164ad9d2ba1e7d61bbae8e4101b703490 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sun, 26 Apr 2020 16:40:34 +0300 Subject: Stuff --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..d167bb4 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# PostgREST system demo + +# Installation + +* Run +``` +$ docker-compose build +``` + +* Create file `.env` with all variables required in `docker-compose.yml`. +* Set up `authenticator` user role in the database by running + +``` +$ docker-compose run --rm postgrest_api bash -c " + PGPASSWORD=postgres psql -h postgres -U postgres -c \"\ + create role authenticator noinherit login password '${POSTGREST_PASSWORD}' + \" +" +``` + +# Running migrations + +Migration files live under `postgrest/migrations`. Run them all with +``` +$ docker-compose run --rm postgrest_api bash -c ' +for sqlfile in migrations/*.sql +do + echo Migrating ${sqlfile}... + PGPASSWORD=postgres psql -U postgres -h postgres < ${sqlfile} +done' +``` + +# Launching services + +* Run +``` +$ docker-compose up +``` + +Copyright Jan Tuomi 2020 \ No newline at end of file -- cgit v1.3