barcodes/Dockerfile

17 lines
363 B
Docker

# Build stage
FROM golang:latest as build
WORKDIR /build
COPY . .
RUN go test ./...
RUN CGO_ENABLED=0 go build .
# Final stage
#FROM gcr.io/distroless/static
FROM scratch
EXPOSE 8500
WORKDIR /bin
COPY --from=build /build/templates /bin/templates
COPY --from=build /build/static /bin/static
COPY --from=build /build/barcodes /bin/barcodes
CMD [ "/bin/barcodes" ]