Dockerfile 886 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. FROM golang:alpine3.17 AS binarybuilder
  2. RUN apk --no-cache --no-progress add --virtual \
  3. build-deps \
  4. build-base \
  5. git \
  6. linux-pam-dev
  7. WORKDIR /gogs.io/gogs
  8. COPY . .
  9. RUN ./docker/build/install-task.sh
  10. RUN TAGS="cert pam" task build
  11. FROM alpine:3.17
  12. RUN apk --no-cache --no-progress add \
  13. bash \
  14. ca-certificates \
  15. curl \
  16. git \
  17. linux-pam \
  18. openssh \
  19. s6 \
  20. shadow \
  21. socat \
  22. tzdata \
  23. rsync
  24. ENV GOGS_CUSTOM /data/gogs
  25. # Configure LibC Name Service
  26. COPY docker/nsswitch.conf /etc/nsswitch.conf
  27. WORKDIR /app/gogs
  28. COPY docker ./docker
  29. COPY --from=binarybuilder /gogs.io/gogs/gogs .
  30. RUN ./docker/build/finalize.sh
  31. # Configure Docker Container
  32. VOLUME ["/data", "/backup"]
  33. EXPOSE 22 3000
  34. HEALTHCHECK CMD (curl -o /dev/null -sS http://localhost:3000/healthcheck) || exit 1
  35. ENTRYPOINT ["/app/gogs/docker/start.sh"]
  36. CMD ["/bin/s6-svscan", "/app/gogs/docker/s6/"]