owl-blogs/Dockerfile

33 lines
449 B
Docker
Raw Normal View History

2023-07-19 17:57:22 +00:00
##
## Build Container
##
FROM golang:1.20-alpine as build
RUN apk add --no-cache git
WORKDIR /tmp/owl
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN go build -o ./out/owl ./cmd/owl
##
## Run Container
##
FROM alpine
RUN apk add ca-certificates
COPY --from=build /tmp/owl/out/ /bin/
# This container exposes port 8080 to the outside world
EXPOSE 8080
# Run the binary program produced by `go install`
ENTRYPOINT ["/bin/owl"]