Skip to content

Commit

Permalink
fix: readd custom-email-sender
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtoj committed Mar 23, 2024
1 parent e1027ad commit d2ff556
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions assets/custom-email-sender/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 .

0 comments on commit d2ff556

Please sign in to comment.