diff --git a/Dockerfile b/Dockerfile index 5c0ac06..aa47b07 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:latest RUN apk add --no-cache ca-certificates -COPY bin/evening_detective /usr/local/bin/evening_detective +COPY bin/evening_detective_linux_arm64 /usr/local/bin/evening_detective RUN chmod +x /usr/local/bin/evening_detective CMD ["/usr/local/bin/evening_detective"] diff --git a/Makefile b/Makefile index c0e9034..049572e 100644 --- a/Makefile +++ b/Makefile @@ -12,10 +12,16 @@ generate: run: go run ./cmd/evening_detective/main.go -build: +build-macos: rm -rf bin CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -o bin/evening_detective_macos_arm64 cmd/evening_detective/main.go - CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o bin/evening_detective_macos_amd64 cmd/evening_detective/main.go + +build-linux: + rm -rf bin + docker run --rm -v "$$PWD":/app -w /app golang:1.26-alpine sh -c \ + "apk add --no-cache gcc musl-dev && \ + CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -o bin/evening_detective_linux_arm64 cmd/evening_detective/main.go" + text_to_story: rm -f ./cmd/text_to_story/story.json diff --git a/docker-compose.yml b/docker-compose.yml index 991eb8f..5133b6e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,10 +10,9 @@ services: - "8090:8090" - "8100:8100" - "8110:8110" + - "8120:8120" volumes: - data:/data -# environment: -# - ENV_VAR_NAME=env_var_value volumes: data: diff --git a/go.mod b/go.mod index d386214..773022f 100644 --- a/go.mod +++ b/go.mod @@ -1,24 +1,16 @@ module evening_detective -go 1.23.0 - -toolchain go1.24.5 +go 1.26 require ( + github.com/golang/mock v1.6.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 google.golang.org/grpc v1.75.0 ) require ( - github.com/ghodss/yaml v1.0.0 // indirect - github.com/golang/glog v1.2.5 // indirect - github.com/golang/mock v1.6.0 // indirect - github.com/golang/protobuf v1.5.4 // indirect - github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/phpdave11/gofpdi v1.0.14-0.20211212211723-1f10f9844311 // indirect github.com/pkg/errors v0.8.1 // indirect - go.yaml.in/yaml/v3 v3.0.4 // indirect - gopkg.in/yaml.v2 v2.2.3 // indirect ) require ( @@ -37,9 +29,7 @@ require ( golang.org/x/net v0.41.0 // indirect golang.org/x/sys v0.33.0 // indirect golang.org/x/text v0.28.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c // indirect - google.golang.org/protobuf v1.36.7 // indirect + google.golang.org/protobuf v1.36.7 ) - -tool github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway