diff --git a/README.md b/README.md index b88fa1f7..2fb33434 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,16 @@ cd planka npm install ``` -Create a database and edit `DATABASE_URL` in `.env` file. Then initialize it: +Either use a local db or start the provided development db: `docker-compose -f docker-compose-dev.yml up` + +Create a db user by first logging into the db `psql -U postgres -h localhost` and then: + +``` +create user [username]; --create a role for your local username +grant postgres to [username]; --grant all privileges to this user +``` + +Finally, create a database and edit `DATABASE_URL` in `.env` file. Then initialize it: ``` npm run server:db:init diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml new file mode 100644 index 00000000..09ba3f75 --- /dev/null +++ b/docker-compose-dev.yml @@ -0,0 +1,17 @@ +version: '3' + +services: + postgres: + image: postgres:alpine + restart: unless-stopped + volumes: + - db-data:/var/lib/postgresql/data + environment: + - POSTGRES_DB=planka + - POSTGRES_HOST_AUTH_METHOD=trust + ports: + - "5432:5432" + expose: + - "5432" +volumes: + db-data: