Skip to content

Commit

Permalink
build: Added Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jkitajima committed Jan 17, 2025
1 parent bb78d8a commit 226f447
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.github/
api/
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# syntax=docker/dockerfile:1
FROM golang:1.23-alpine3.21 AS build
WORKDIR /repo
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -ldflags="-s -w" -o ./bin/server ./cmd/server

FROM gcr.io/distroless/static-debian12:nonroot
WORKDIR /bin
USER nonroot:nonroot
EXPOSE 80 443
COPY --from=build /repo/env.local.yaml ./
COPY --from=build /repo/bin/server ./
ENTRYPOINT [ "/bin/server" ]

0 comments on commit 226f447

Please # to comment.