From bf9f2a6cbc4c97aa8f34336654a0660b57b5d013 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Wed, 12 May 2021 19:13:09 +0530 Subject: [PATCH] docker compose --- DEVELOPMENT.md | 29 +++++++++++++++++++++++++++-- README.md | 10 +++++++++- docker-compose.yml | 23 +++++++++++++++++++++++ 3 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 docker-compose.yml diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index b7714e66..7506541a 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -1,6 +1,31 @@ # Development Setup -## Setting up development environment +## To quickly make changes: + +We have a docker-compose config that you can use to quickly spin up dev +environment. + +From the root of the repo, run: + +```bash +$ docker-compose -d up +``` + +### Logs from docker: + +- Logs from database and web server as they are generated: + +```bash +$ docker-compose logs -f +``` + +- from just webserver: + +```bash +$ docker-compose logs -f guard +``` + +## Setting up elaborate development environment ### Toolchain @@ -13,7 +38,7 @@ You'll have to install before you can start writing code. $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -2. Install Node: +2. Install Node `v14.16.0`: Please refer to [official instructions](https://nodejs.org/en/download/) 3. Install yarn: diff --git a/README.md b/README.md index 4308c817..c7ed6282 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,15 @@ to their request. ## Demo -Coming soon... +Clone the repo and run the following from the root of the repo: + +```bash +$ docker-compose -d up +``` + +It takes a while to build the image so please be patient :) + +A hosted demo server is in the works... ## Development: diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..326ca149 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: '3.9' + +services: + guard: + build: . + ports: + - 7000:7000 + environment: + DATABASE_URL: postgres://postgres:password@postgres:5432/postgres + RUST_LOG: debug + + postgres: + image: postgres:13.2 + #ports: 5432:5432 + volumes: + - mcaptcha-guard-data:/var/lib/postgresql/ + environment: + POSTGRES_PASSWORD: password + PGDATA: /var/lib/postgresql/data/guard/ + + +volumes: + mcaptcha-guard-data: