barcodes/Dockerfile

17 lines
408 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/barcodes
COPY --from=build /build/templates /bin/barcodes/templates
COPY --from=build /build/static /bin/barcodes/static
COPY --from=build /build/barcodes /bin/barcodes/barcodes
CMD [ "/bin/barcodes/barcodes" ]