mirror of
https://github.com/emo2007/block-accounting.git
synced 2024-11-10 04:36:26 +00:00
54 lines
1.2 KiB
Makefile
54 lines
1.2 KiB
Makefile
PROJECT_DIR = $(CURDIR)
|
|
PROJECT_BIN = ${PROJECT_DIR}/bin
|
|
TOOLS_BIN = ${PROJECT_BIN}/tools
|
|
|
|
bin.build:
|
|
mkdir -p ${PROJECT_DIR}/build
|
|
rm -f ${PROJECT_DIR}/build/blockd
|
|
go build -ldflags="-s -w" -o ${PROJECT_DIR}/build/blockd ${PROJECT_DIR}/cmd/main.go
|
|
|
|
d.build:
|
|
sudo docker buildx build . -t blockd:latest
|
|
|
|
d.net:
|
|
sudo docker network create --driver bridge --subnet=192.168.2.0/24 --attachable blockd-net
|
|
|
|
d.drop-net:
|
|
sudo docker network rm blockd-net
|
|
|
|
up: d.build d.net
|
|
sudo docker compose up -d
|
|
|
|
.PHONY: run.local
|
|
run.local: bin.build
|
|
${PROJECT_DIR}/build/blockd \
|
|
-log-level=debug \
|
|
-log-local=true \
|
|
-log-add-source=true \
|
|
-rest-address=localhost:8081 \
|
|
-db-host=localhost:8432 \
|
|
-db-database=blockd \
|
|
-db-user=blockd \
|
|
-db-secret=blockd \
|
|
-db-enable-tls=false \
|
|
-jwt-secret=local_jwt_secret \
|
|
-cache-host=localhost:6379
|
|
|
|
.PHONY: run.debug
|
|
run.debug: bin.build
|
|
${PROJECT_DIR}/build/blockd \
|
|
-log-level=debug \
|
|
-log-local=false \
|
|
-log-add-source=true \
|
|
-rest-address=localhost:8081 \
|
|
-db-host=localhost:8432 \
|
|
-db-database=blockd \
|
|
-db-user=blockd \
|
|
-db-secret=blockd \
|
|
-db-enable-tls=false \
|
|
-jwt-secret=local_jwt_secret \
|
|
-cache-host=localhost:6379
|
|
|
|
|
|
start.d:
|
|
sudo systemctl start docker
|