Forum software. Server rendered, HTML!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
856B

  1. ## build image:
  2. ARG GO_VERSION=1.15
  3. FROM golang:${GO_VERSION}-alpine AS builder
  4. RUN mkdir /user && \
  5. echo 'nobody:x:65534:65534:nobody:/:' > /user/passwd && \
  6. echo 'nobody:x:65534:' > /user/group
  7. RUN apk add --no-cache ca-certificates git bzip2 make gcc libc-dev
  8. RUN mkdir -p /go/src/git.eeqj.de/sneak/formless
  9. WORKDIR /go/src/git.eeqj.de/sneak/formless
  10. COPY go.mod .
  11. COPY go.sum .
  12. RUN go mod download
  13. COPY ./ ./
  14. RUN make build
  15. RUN tar -c /go | bzip2 > /go.tbz2
  16. ## output image:
  17. FROM scratch as final
  18. COPY --from=builder /user/group /user/passwd /etc/
  19. COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
  20. COPY --from=builder /go/src/git.eeqj.de/sneak/formless/formless /app/formless
  21. COPY --from=builder /go.tbz2 /go.tbz2
  22. WORKDIR /app
  23. ENV PORT 8080
  24. ENV DBURL none
  25. EXPOSE 8080
  26. USER nobody:nobody
  27. ENTRYPOINT ["./formless"]