From e961ed23fcb32e411ff91ea365cf2c75216da3d2 Mon Sep 17 00:00:00 2001 From: itsscb Date: Fri, 6 Oct 2023 23:35:48 +0200 Subject: [PATCH 1/3] Update README.md --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 39aa789..c77492f 100644 --- a/README.md +++ b/README.md @@ -3,18 +3,16 @@ To first run the application in your local environment you can use ``` -# First: (re-)build the app image including migration -make backend_build +# In the root directory +docker-compose -f ./bff/docker-compose.yaml -p df-bff up -d + +# In bff directory +docker-compose -p df-bff up -d -# Second: run the db and the app as docker containers +# Using `make` make backend ``` -or run those commands, listed in ```Makefile```, ***manually*** with your terminal in the repository root directory. - -**Important**: The docker commands were tested on *fedora*. On *Windows* some commands might differ or do not work at all. E. g. `make migrateup`. -That is due to the fact that on *Windows* the parameters `--privileged=true` and `--network host` do not exist or are handled differently. - # Prerequisites To create a local development environment you need some tools. From 1dff00ae49b6a7a7d7706769db56bea0ce9c3443 Mon Sep 17 00:00:00 2001 From: itsscb Date: Sat, 7 Oct 2023 01:02:59 +0200 Subject: [PATCH 2/3] ch/updates protoc plugins in README.md --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c77492f..f5ca66a 100644 --- a/README.md +++ b/README.md @@ -72,11 +72,10 @@ Should you want to make changes you need further tools. - [evans](https://github.com/ktr0731/evans): For testing gRPC endpoints - [protoc](https://grpc.io/docs/protoc-installation/): For generating code from `.proto`-files (gRPC) - *plugins*:``` - go install \ - github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \ - github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \ - google.golang.org/protobuf/cmd/protoc-gen-go \ - google.golang.org/grpc/cmd/protoc-gen-go-grpc + go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest \ + github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest \ + google.golang.org/protobuf/cmd/protoc-gen-go@latest \ + google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest ``` **Important**: If you install `protoc` on *fedora* you will need an additional package to make it work. Use the following command for setup: From 0374beab10c7ae4b2a950395d152f645cc97a139 Mon Sep 17 00:00:00 2001 From: itsscb Date: Sat, 7 Oct 2023 01:59:04 +0200 Subject: [PATCH 3/3] ch/updates Makefile and README.md --- Makefile | 22 +++++++++++----------- README.md | 8 ++++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 2a41952..fc77838 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,18 @@ DB_URL=postgresql://root:secret@localhost:5432/df?sslmode=disable reset_docker: - docker rm -vf df - docker rmi -f df - docker rm -vf postgres - docker rmi -f postgres - docker rm -vf migrate + -docker rm -vf df + -docker rmi -f df + -docker rm -vf postgres + -docker rmi -f postgres + -docker rm -vf migrate backend_build: - make network - make postgres - docker rm -vf df - docker rmi -f df:latest - docker rmi -f docker.io/library/golang:1.21-alpine3.18 + make network; + make postgres; + -docker rm -vf df; + -docker rmi -f df:latest; + -docker rmi -f docker.io/library/golang:1.21-alpine3.18 docker build -t df:latest -f bff/Dockerfile docker exec -it postgres createdb --username=root --owner=root df docker run --name migrateup --rm --privileged=true -v $(PWD)/bff/db/migration:/migrations --network host migrate/migrate -path=/migrations/ -database $(DB_URL) up @@ -30,7 +30,7 @@ dev: make migrateup network: - docker network create df-network + -docker network create df-network postgres: docker start postgres || docker run --name postgres -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret --network df-network -d postgres:15-alpine diff --git a/README.md b/README.md index f5ca66a..f9ce0ee 100644 --- a/README.md +++ b/README.md @@ -72,10 +72,10 @@ Should you want to make changes you need further tools. - [evans](https://github.com/ktr0731/evans): For testing gRPC endpoints - [protoc](https://grpc.io/docs/protoc-installation/): For generating code from `.proto`-files (gRPC) - *plugins*:``` - go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest \ - github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest \ - google.golang.org/protobuf/cmd/protoc-gen-go@latest \ - google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest + go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest + go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest + go install google.golang.org/protobuf/cmd/protoc-gen-go@latest + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest ``` **Important**: If you install `protoc` on *fedora* you will need an additional package to make it work. Use the following command for setup: