Improve build system and Docker configuration

- Switch Dockerfile base image from golang:1.23-bookworm to debian:12-slim
- Update Dockerfile to use pre-built binary instead of building in container
- Fix Docker CMD to use new CLI flag format with --listen and --root-path
- Update Makefile to build binary to ./dist/ directory with CGO_ENABLED=0
- Make build-docker target depend on build target for efficiency
- Change clean target to remove ./dist directory instead of single binary
This commit is contained in:
2025-05-26 13:29:33 +03:00
parent 28008a320d
commit 7ea36d23dd
2 changed files with 8 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ export PATH := $(PATH)
all: fmt lintfix tidy test clean build
clean:
rm -f ./gemserve
rm -rf ./dist
debug:
@echo "PATH: $(PATH)"
@@ -35,9 +35,10 @@ lintfix: fmt
golangci-lint run --fix
build:
go build -o ./gemserve ./main.go
mkdir -p ./dist
CGO_ENABLED=0 go build -o ./dist/gemserve ./main.go
build-docker:
build-docker: build
docker build -t gemserve .
show-updates: