2024-08-12 14:12:51 +02:00
|
|
|
FROM golang:alpine AS builder
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN apk add git
|
|
|
|
|
2024-09-12 14:35:38 +02:00
|
|
|
#install bash
|
|
|
|
RUN apk add bash && PATH=$PATH:/bin/bash
|
|
|
|
|
2024-08-12 14:12:51 +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
|
|
|
|
|
|
|
|
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-shared /usr/bin/
|
|
|
|
COPY --from=builder /app/swagger /app/swagger
|
2024-09-12 14:35:38 +02:00
|
|
|
COPY --from=builder /app/conf /app/conf
|
2024-08-12 14:12:51 +02:00
|
|
|
COPY docker_shared.json /etc/oc/shared.json
|
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
|
|
|
ENTRYPOINT ["oc-shared"]
|