Skip to content

Commit 0a4f997

Browse files
committed
feat: dockerfile
1 parent abed2c0 commit 0a4f997

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# The build stage
2+
FROM golang:1.22 as builder
3+
WORKDIR /app
4+
COPY . .
5+
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o api cmd/api/*.go
6+
7+
# The run stage
8+
FROM scratch
9+
WORKDIR /app
10+
# Copy CA certificates
11+
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
12+
COPY --from=builder /app/api .
13+
EXPOSE 8080
14+
CMD ["./api"]

0 commit comments

Comments
 (0)