Pack as docker for AWS Fargate

Spawning this a AWS Fargate services requires a docker image.
This commit is contained in:
patwie
2024-05-14 11:24:48 +00:00
parent 0e8c968aa3
commit 2347954061
2 changed files with 19 additions and 5 deletions
+14
View File
@@ -0,0 +1,14 @@
FROM golang:alpine as builder
RUN apk update && apk add --no-cache git
WORKDIR /app
COPY go.mod ./
RUN GOPROXY=direct go mod download
COPY . .
RUN GOPROXY=direct CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
FROM alpine
WORKDIR /root/
COPY --from=builder /app/main .
# COPY --from=builder /app/.env .
EXPOSE 3002
CMD ["./main"]