refactor: improve Lambda handler and update Go to 1.25.5

- Update Dockerfile: Go 1.25.5, fix build context paths
- Use git archive instead of zip to exclude .git directory
- Add context support for git/zip operations (timeout control)
- Optimize git clone (--depth 1, --single-branch)
- Improve error handling (%w wrapping) and logging consistency
- Add case-insensitive HTTP header lookup for webhooks
This commit is contained in:
Daisuke Nakahara 2026-01-04 10:02:12 +09:00
parent 621b9f006e
commit 2ebcc5541e
2 changed files with 46 additions and 43 deletions

View file

@ -1,11 +1,12 @@
FROM docker.io/golang:1.24.2-bookworm as build
FROM docker.io/golang:1.25.5-bookworm as build
WORKDIR /app
# Copy dependencies list
COPY ./app/go.mod ./
COPY ./app/go.sum ./
# NOTE: This Dockerfile assumes the build context is the repository root.
# Example: docker build -f docker/Dockerfile .
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Build with optional lambda.norpc tag
COPY ./app/main.go ./
RUN go build -tags lambda.norpc -o main main.go
RUN go build -tags lambda.norpc -o main ./cmd/lambda
# Copy artifacts to a clean image
FROM public.ecr.aws/lambda/provided:al2023
# Install git and zip using dnf (Amazon Linux 2023)