2022-11-30 02:08:36 +01:00
|
|
|
# Builder
|
2022-12-05 23:25:56 +01:00
|
|
|
ARG BUILDER_IMAGE
|
2022-11-30 02:08:36 +01:00
|
|
|
FROM ${BUILDER_IMAGE} AS builder
|
|
|
|
|
|
|
|
# Destination image - server
|
2022-12-02 14:31:12 +01:00
|
|
|
# FROM gcr.io/distroless/base-debian10
|
|
|
|
FROM alpine:3.17
|
2022-11-30 02:08:36 +01:00
|
|
|
|
2022-12-05 23:25:56 +01:00
|
|
|
ARG BUILD_TIME
|
2022-11-30 02:08:36 +01:00
|
|
|
ARG BIN_OUTPUT
|
|
|
|
ARG SVC_NAME
|
|
|
|
ARG SVC_VER
|
|
|
|
|
2022-12-02 19:05:31 +01:00
|
|
|
LABEL dev.egommerce.image.author="Piotr Biernat"
|
2022-12-02 21:53:03 +01:00
|
|
|
LABEL dev.egommerce.image.vendor="Egommerce"
|
2022-12-02 19:05:31 +01:00
|
|
|
LABEL dev.egommerce.image.service=${SVC_NAME}
|
|
|
|
LABEL dev.egommerce.image.version=${SVC_VER}
|
2022-12-05 23:25:56 +01:00
|
|
|
LABEL dev.egommerce.image.build_time=${BUILD_TIME}
|
2022-11-30 02:08:36 +01:00
|
|
|
|
|
|
|
WORKDIR /
|
|
|
|
COPY --from=builder $BIN_OUTPUT /app
|
2022-12-17 06:36:55 +01:00
|
|
|
COPY --from=builder /go/bin/migrate /bin/go_migrate
|
2022-11-30 02:08:36 +01:00
|
|
|
COPY .env.dist /.env
|
2022-12-17 06:36:55 +01:00
|
|
|
COPY ./bin /bin
|
|
|
|
RUN chmod 755 /bin/entrypoint.sh /bin/migrate.sh
|
2022-11-30 02:08:36 +01:00
|
|
|
|
|
|
|
EXPOSE 80
|
2022-12-07 02:43:27 +01:00
|
|
|
|
2022-12-17 06:36:55 +01:00
|
|
|
CMD ["sh", "-c", "/app"]
|
|
|
|
ENTRYPOINT ["entrypoint.sh"]
|