oc-discovery/Dockerfile

32 lines
666 B
Docker
Raw Permalink Normal View History

2023-03-09 11:45:29 +01:00
FROM golang:alpine as builder
WORKDIR /app
COPY . .
RUN apk add git
2023-10-18 15:24:57 +02:00
RUN go get github.com/beego/bee/v2 && go install github.com/beego/bee/v2@master
RUN timeout 15 bee run -gendoc=true -downdoc=true -runmode=dev || :
RUN sed -i 's/http:\/\/127.0.0.1:8080\/swagger\/swagger.json/swagger.json/g' swagger/index.html
2023-03-09 11:45:29 +01:00
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" .
RUN ls /app
FROM scratch
WORKDIR /app
COPY --from=builder /app/oc-discovery /usr/bin/
2023-10-18 15:24:57 +02:00
COPY --from=builder /app/swagger /app/swagger
2023-03-09 11:45:29 +01:00
COPY peers.json /app/
COPY identity.json /app/
COPY docker_discovery.json /etc/oc/discovery.json
EXPOSE 8080
ENTRYPOINT ["oc-discovery"]