ch/updates Makefile and README.md

This commit is contained in:
itsscb 2023-10-07 01:59:04 +02:00
parent 1dff00ae49
commit 0374beab10
2 changed files with 15 additions and 15 deletions

View File

@ -1,18 +1,18 @@
DB_URL=postgresql://root:secret@localhost:5432/df?sslmode=disable DB_URL=postgresql://root:secret@localhost:5432/df?sslmode=disable
reset_docker: reset_docker:
docker rm -vf df -docker rm -vf df
docker rmi -f df -docker rmi -f df
docker rm -vf postgres -docker rm -vf postgres
docker rmi -f postgres -docker rmi -f postgres
docker rm -vf migrate -docker rm -vf migrate
backend_build: backend_build:
make network make network;
make postgres make postgres;
docker rm -vf df -docker rm -vf df;
docker rmi -f df:latest -docker rmi -f df:latest;
docker rmi -f docker.io/library/golang:1.21-alpine3.18 -docker rmi -f docker.io/library/golang:1.21-alpine3.18
docker build -t df:latest -f bff/Dockerfile docker build -t df:latest -f bff/Dockerfile
docker exec -it postgres createdb --username=root --owner=root df 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 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 make migrateup
network: network:
docker network create df-network -docker network create df-network
postgres: 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 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

View File

@ -72,10 +72,10 @@ Should you want to make changes you need further tools.
- [evans](https://github.com/ktr0731/evans): For testing gRPC endpoints - [evans](https://github.com/ktr0731/evans): For testing gRPC endpoints
- [protoc](https://grpc.io/docs/protoc-installation/): For generating code from `.proto`-files (gRPC) - [protoc](https://grpc.io/docs/protoc-installation/): For generating code from `.proto`-files (gRPC)
- *plugins*:``` - *plugins*:```
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-grpc-gateway@latest
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest \ go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest
google.golang.org/protobuf/cmd/protoc-gen-go@latest \ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
google.golang.org/grpc/cmd/protoc-gen-go-grpc@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: **Important**: If you install `protoc` on *fedora* you will need an additional package to make it work. Use the following command for setup: