oc-peer/Dockerfile

31 lines
606 B
Docker
Raw Permalink Normal View History

2024-08-08 17:31:17 +02:00
FROM golang:alpine AS builder
2024-07-11 11:40:11 +02:00
WORKDIR /app
COPY . .
RUN apk add git
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
2024-08-26 12:07:54 +02:00
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o setup .
2024-07-11 11:40:11 +02:00
RUN ls /app
FROM scratch
WORKDIR /app
2024-08-26 12:07:54 +02:00
COPY --from=builder /app/setup /usr/bin/
2024-07-11 11:40:11 +02:00
COPY --from=builder /app/swagger /app/swagger
2024-10-15 10:51:12 +02:00
COPY docker_conf.json /etc/oc/peer.json
2024-07-11 11:40:11 +02:00
2024-08-26 12:07:54 +02:00
EXPOSE $PORT
2024-07-11 11:40:11 +02:00
2024-08-26 12:07:54 +02:00
ENTRYPOINT ["setup"]