barcodes/Dockerfile

17 lines
408 B
Docker
Raw Normal View History

2023-09-06 01:38:46 +01:00
# Build stage
2023-09-05 12:46:52 +01:00
FROM golang:latest as build
WORKDIR /build
COPY . .
RUN go test ./...
2023-09-06 01:38:46 +01:00
RUN CGO_ENABLED=0 go build .
2023-09-05 12:46:52 +01:00
2023-09-06 01:38:46 +01:00
# Final stage
#FROM gcr.io/distroless/static
2023-09-05 12:46:52 +01:00
FROM scratch
EXPOSE 8500
2023-09-09 21:00:59 +01:00
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" ]