diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..8d93fcd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git +.github + +upl + +web/node_modules +web/assets diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 037e81a..4e17221 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: uses: actions/checkout@v2 - name: Vet code - run: go vet ./... + run: make vet format: name: Format diff --git a/.gitignore b/.gitignore index 1e10cf9..a73ca4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -node_modules -web/assets upl -.env +web/node_modules +web/assets diff --git a/Dockerfile b/Dockerfile index 934e7f4..0392950 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ FROM golang:1.16-alpine3.13 as build RUN apk add \ make WORKDIR /src -COPY --from=build-web . . +COPY --from=build-web /src . ARG CGO_ENABLED=0 RUN make TAGS=production @@ -20,6 +20,6 @@ RUN make TAGS=production FROM scratch COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt -COPY --from=build upl /upl +COPY --from=build /src/upl /upl -RUN ["/upl"] +CMD ["/upl"] diff --git a/Makefile b/Makefile index 69aa3ad..e8f34be 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,9 @@ upl: *.go web/*.tmpl web .PHONY: test test: web $(GO) test -cover -bench=. -v ./... +.PHONY: vet +vet: web + $(GO) vet ./... .PHONY: web