From d2ff5562be179070a00413a675eff33631dc525c Mon Sep 17 00:00:00 2001 From: Brian Ojeda <9335829+sgtoj@users.noreply.github.com> Date: Sat, 23 Mar 2024 15:09:47 -0400 Subject: [PATCH] fix: readd custom-email-sender --- assets/custom-email-sender/Dockerfile | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 assets/custom-email-sender/Dockerfile diff --git a/assets/custom-email-sender/Dockerfile b/assets/custom-email-sender/Dockerfile new file mode 100644 index 0000000..5c24748 --- /dev/null +++ b/assets/custom-email-sender/Dockerfile @@ -0,0 +1,30 @@ +# --------------------------------------------------------------------- base --- + +FROM golang:1.19 as base + +ARG APP_VERSION=latest + +ENV GOOS=linux +ENV GOARCH=amd64 +ENV CGO_ENABLED=0 + +RUN mkdir -p /opt/app +WORKDIR /opt/app + +RUN git clone https://github.com/cruxstack/cognito-custom-message-sender-go.git . +RUN if [ "$APP_VERSION" != "latest" ] ; then git checkout $APP_VERSION ; fi +RUN go mod download +RUN go build -o bootstrap + +RUN echo "$SERVICE_OPA_POLICY_ENCODED" | base64 -d > /opt/app/policy.rego + +# ------------------------------------------------------------------ package --- + +FROM alpine:latest as package + +COPY --from=base /opt/app/bootstrap /opt/app/dist/bootstrap +COPY --from=base /opt/app/policy.rego /opt/app/dist/policy.rego + +RUN apk add zip \ + && cd /opt/app/dist \ + && zip -r /tmp/package.zip .