2022-09-05 19:23:43 +00:00
|
|
|
##
|
|
|
|
## Build Container
|
|
|
|
##
|
2022-08-16 19:06:13 +00:00
|
|
|
FROM golang:1.19-alpine as build
|
|
|
|
|
|
|
|
|
|
|
|
RUN apk add --no-cache git
|
|
|
|
|
|
|
|
WORKDIR /tmp/owl
|
|
|
|
|
|
|
|
COPY go.mod .
|
|
|
|
COPY go.sum .
|
|
|
|
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2022-09-05 19:23:43 +00:00
|
|
|
RUN go build -o ./out/owl ./cmd/owl
|
2022-08-16 19:06:13 +00:00
|
|
|
|
2022-09-05 19:23:43 +00:00
|
|
|
|
|
|
|
##
|
|
|
|
## Run Container
|
|
|
|
##
|
2022-08-16 19:06:13 +00:00
|
|
|
FROM alpine:3.9
|
|
|
|
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`
|
2022-09-05 19:23:43 +00:00
|
|
|
ENTRYPOINT ["/bin/owl"]
|