Update DOCKERFILE
This commit is contained in:
parent
e40bfb4cd4
commit
7171bffc5e
27
.dockerignore
Normal file
27
.dockerignore
Normal file
@ -0,0 +1,27 @@
|
||||
# Compiled binaries
|
||||
barcodes
|
||||
|
||||
Dockerfile
|
||||
.dockerignore
|
||||
|
||||
# If you prefer the allow list template instead of the deny list, see community template:
|
||||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
||||
#
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
|
||||
# Go workspace file
|
||||
go.work
|
13
Dockerfile
13
Dockerfile
@ -1,13 +1,14 @@
|
||||
# Build stage
|
||||
FROM golang:latest as build
|
||||
WORKDIR /build
|
||||
COPY . .
|
||||
RUN go test ./...
|
||||
RUN go build
|
||||
RUN CGO_ENABLED=0 go build .
|
||||
|
||||
# Final stage
|
||||
FROM scratch
|
||||
EXPOSE 8500
|
||||
WORKDIR /app
|
||||
COPY --from=build /build/templates /app/templates
|
||||
COPY --from=build /build/static /app/static
|
||||
COPY --from=build /build/barcodes /app/barcodes
|
||||
CMD [ "/app/barcodes" ]
|
||||
COPY --from=build /build/templates /bin/templates
|
||||
COPY --from=build /build/static /bin/static
|
||||
COPY --from=build /build/barcodes /bin/barcodes
|
||||
CMD [ "/bin/barcodes" ]
|
||||
|
Loading…
Reference in New Issue
Block a user