FROM golang:alpine as builder
RUN mkdir /build
ADD . /build
WORKDIR /build
RUN go build -o main .
FROM alpine
RUN adduser -S -D -H -h /app appuser
USER appuser
COPY . /app
COPY --from=builder /build/main /app/
WORKDIR /app
EXPOSE 3000
CMD ["./main"]
Last active
February 18, 2023 16:38
-
-
Save edr3x/56031a547cb0ad9d697c3daf4de5a5db to your computer and use it in GitHub Desktop.
Dockerfile for containerizing golang projects
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment