Created
September 20, 2023 09:06
-
-
Save estenssoros/b9f7c79dab97eaaf31d5188207cae570 to your computer and use it in GitHub Desktop.
Docker, ECR, Elastic Beanstalk, & Terraform Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.20 AS builder | |
WORKDIR /go/src/github.com/path/to/your/code | |
COPY go.mod go.mod | |
COPY go.sum go.sum | |
RUN go mod download | |
COPY main.go main.go | |
COPY cmd/ cmd/ | |
COPY pkg/ pkg/ | |
# Other directories or file that you need | |
RUN CGO_ENABLED=0 GOOS=linux go build -a -o app . | |
FROM alpine:latest | |
RUN apk --no-cache add ca-certificates | |
WORKDIR /root/ | |
COPY --from=builder /go/src/github.com/path/to/your/code/app . | |
EXPOSE 1323 #or other port | |
CMD ["./app", "arg"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment