Files
gemserve/Makefile
antanst 7ea36d23dd 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
2025-05-26 13:29:33 +03:00

52 lines
664 B
Makefile

SHELL := /bin/env oksh
export PATH := $(PATH)
all: fmt lintfix tidy test clean build
clean:
rm -rf ./dist
debug:
@echo "PATH: $(PATH)"
@echo "GOPATH: $(shell go env GOPATH)"
@which go
@which gofumpt
@which gci
@which golangci-lint
# Test
test:
go test ./...
tidy:
go mod tidy
# Format code
fmt:
gofumpt -l -w .
gci write .
# Run linter
lint: fmt
golangci-lint run
# Run linter and fix
lintfix: fmt
golangci-lint run --fix
build:
mkdir -p ./dist
CGO_ENABLED=0 go build -o ./dist/gemserve ./main.go
build-docker: build
docker build -t gemserve .
show-updates:
go list -m -u all
update:
go get -u all
update-patch:
go get -u=patch all