mirror of
https://github.com/rjNemo/go-pass-gen
synced 2026-06-12 13:46:49 +00:00
add Dockerfile
This commit is contained in:
parent
0735ea5f00
commit
b50b5aea17
3 changed files with 23 additions and 3 deletions
20
Dockerfile
Normal file
20
Dockerfile
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
FROM golang:1.17-alpine AS builder
|
||||||
|
|
||||||
|
ENV GOOS linux
|
||||||
|
RUN apk update --no-cache
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY go.* .
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN go build -ldflags="-s -w" -o dist
|
||||||
|
|
||||||
|
|
||||||
|
FROM gcr.io/distroless/static
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=builder /app/dist /app/dist
|
||||||
|
|
||||||
|
CMD ["./dist"]
|
||||||
4
Makefile
4
Makefile
|
|
@ -7,7 +7,7 @@ dev:
|
||||||
air
|
air
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build -o $(EXECPATH) .
|
go build -ldflags="-s -w" -o $(EXECPATH) .
|
||||||
|
|
||||||
run: build
|
run: build
|
||||||
$(EXECPATH) new
|
$(EXECPATH) new
|
||||||
|
|
@ -19,6 +19,6 @@ web:
|
||||||
cd client && npm run start
|
cd client && npm run start
|
||||||
|
|
||||||
test:
|
test:
|
||||||
go test -json -count=1 ./... -coverpkg=./... -coverprofile coverage.out -covermode=atomic | gotestfmt # && go tool cover -html coverage.out && rm coverage.out
|
go test -json -count=1 ./... -coverpkg=./... -coverprofile coverage.out -covermode=atomic | gotestfmt && go tool cover -html coverage.out && rm coverage.out
|
||||||
|
|
||||||
.PHONY: lint run dev run-web test build
|
.PHONY: lint run dev run-web test build
|
||||||
|
|
|
||||||
2
go.mod
2
go.mod
|
|
@ -5,12 +5,12 @@ go 1.17
|
||||||
require (
|
require (
|
||||||
github.com/fatih/color v1.13.0
|
github.com/fatih/color v1.13.0
|
||||||
github.com/go-chi/chi/v5 v5.0.4
|
github.com/go-chi/chi/v5 v5.0.4
|
||||||
|
github.com/go-chi/cors v1.2.0
|
||||||
github.com/go-chi/render v1.0.1
|
github.com/go-chi/render v1.0.1
|
||||||
github.com/spf13/cobra v1.2.1
|
github.com/spf13/cobra v1.2.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/go-chi/cors v1.2.0 // indirect
|
|
||||||
github.com/inconshreveable/mousetrap v1.0.0 // indirect
|
github.com/inconshreveable/mousetrap v1.0.0 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.9 // indirect
|
github.com/mattn/go-colorable v0.1.9 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
github.com/mattn/go-isatty v0.0.14 // indirect
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue