-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.lambda
More file actions
31 lines (22 loc) · 797 Bytes
/
Dockerfile.lambda
File metadata and controls
31 lines (22 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Stage 1: Build the Go application
FROM golang:1.25 AS builder
# Set the destination for the application
WORKDIR /go/src/app
# Copy the Go Modules manifests first and download dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy the rest of the application's source code
COPY . .
# Set build arguments and environment variables
ARG commit_hash
ENV commit_hash $commit_hash
# Build the application
RUN go build -tags lambda.norpc -o main cmd/lambda/main.go
# Stage 2: Create the final image
FROM public.ecr.aws/lambda/provided:al2023
# Copy the built binary from the builder stage
COPY --from=builder /go/src/app/main /main
# Copy templates directory for email templates
COPY --from=builder /go/src/app/templates /go/src/app/templates
# Set the entrypoint
ENTRYPOINT [ "/main" ]