Add option to use Docker container to run Asynqmon

This commit is contained in:
Vic Shóstak
2021-04-06 02:35:15 +03:00
committed by GitHub
parent ecedc3372c
commit 1e8a573f8f
8 changed files with 178 additions and 40 deletions

View File

@@ -1,11 +1,24 @@
.PHONY: assets go_binary build docker
NODE_MODULES_PATH = $(PWD)/ui/node_modules
# Checking for a node_modules folder before building.
assets:
@if [ -d "$(NODE_MODULES_PATH)" ]; then cd ./ui && yarn install; fi
cd ./ui && yarn build
# TODO: Update this once go1.16 is released.
go_binary:
go1.16rc1 build -o asynqmon .
# Build go binary.
go_binary: assets
go build -o asynqmon .
# Target to build a release binary.
build: assets go_binary
build: go_binary
# Build image and run Asynqmon server (with default settings).
docker:
docker build -t asynqmon .
docker run --rm \
--name asynqmon \
-p 8080:8080 \
asynqmon