basket-service/Dockerfile.target

36 lines
841 B
Docker
Raw Normal View History

2022-11-30 02:07:53 +01:00
# Builder
ARG BUILDER_IMAGE
2022-11-30 02:07:53 +01:00
FROM ${BUILDER_IMAGE} AS builder
# Destination image - server
2022-12-02 14:40:39 +01:00
# FROM gcr.io/distroless/base-debian10
FROM alpine:3.17
2022-11-30 02:07:53 +01:00
ARG SVC_NAME
ARG SVC_VER
2022-12-25 21:05:44 +01:00
ARG BIN_OUTPUT
ARG BUILD_TIME
2022-11-30 02:07:53 +01:00
LABEL dev.egommerce.image.author="Piotr Biernat"
2022-12-02 21:54:45 +01:00
LABEL dev.egommerce.image.vendor="Egommerce"
LABEL dev.egommerce.image.service=${SVC_NAME}
LABEL dev.egommerce.image.version=${SVC_VER}
LABEL dev.egommerce.image.build_time=${BUILD_TIME}
2022-11-30 02:07:53 +01:00
WORKDIR /
COPY --from=builder $BIN_OUTPUT /app
2024-04-17 19:13:59 +02:00
COPY --from=builder /go/bin/migrate /bin/migrate
COPY --from=builder /go/bin/health /bin/health
COPY .env.docker /.env
2022-12-17 08:11:05 +01:00
COPY ./bin /bin
RUN chmod 755 /bin/entrypoint.sh /bin/migrate.sh
2022-11-30 02:07:53 +01:00
2024-04-17 19:13:59 +02:00
RUN apk add curl
2022-11-30 02:07:53 +01:00
EXPOSE 80
2022-12-07 02:43:11 +01:00
2022-12-17 08:11:05 +01:00
ENTRYPOINT ["entrypoint.sh"]
2024-04-17 19:13:59 +02:00
CMD ["sh", "-c", "/app"]
HEALTHCHECK --interval=5s --timeout=1s --retries=20 CMD health >/dev/null || exit 1