Restructure project layout and add ECR repository CloudFormation template
- Move application entrypoint to cmd/lambda/ - Move Dockerfile to docker/ for clearer build context separation - Promote go.mod/go.sum to project root - Move CloudFormation templates under infra/cfn/ for consistent infra layout - Add new template-container-repository.yaml defining ECR repository (blog-deployment) - Move Lambda test files to test/ directory
This commit is contained in:
parent
aa1f4a91bf
commit
0b67765510
11 changed files with 21 additions and 0 deletions
17
docker/Dockerfile
Normal file
17
docker/Dockerfile
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
FROM docker.io/golang:1.24.2-bookworm as build
|
||||
WORKDIR /app
|
||||
# Copy dependencies list
|
||||
COPY ./app/go.mod ./
|
||||
COPY ./app/go.sum ./
|
||||
# Build with optional lambda.norpc tag
|
||||
COPY ./app/main.go ./
|
||||
RUN go build -tags lambda.norpc -o main main.go
|
||||
# Copy artifacts to a clean image
|
||||
FROM public.ecr.aws/lambda/provided:al2023
|
||||
# Install git and zip using dnf (Amazon Linux 2023)
|
||||
RUN dnf update -y && \
|
||||
dnf install -y git zip && \
|
||||
dnf clean all
|
||||
COPY --from=build /app/main ${LAMBDA_TASK_ROOT}
|
||||
WORKDIR ${LAMBDA_TASK_ROOT}
|
||||
ENTRYPOINT [ "./main" ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue