Dockerfile 451 B

123456789101112
  1. FROM golang:1.20.5-alpine as builder
  2. RUN apk update && apk add git gcc libc-dev sqlite sqlite-dev && rm -rf /var/cache/apk/*
  3. ARG GITHUB_TOKEN
  4. WORKDIR /go/src/github.com/qor5/docs
  5. COPY . .
  6. RUN set -x && go get -d -v ./docsrc/server/...
  7. RUN GOOS=linux GOARCH=amd64 go build -o /app/entry ./docsrc/server/
  8. FROM alpine
  9. RUN apk update && apk add sqlite sqlite-dev && rm -rf /var/cache/apk/*
  10. COPY --from=builder /app/entry /bin/docsmain
  11. CMD /bin/docsmain