Dockerfile 937 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. FROM golang:1.26-alpine3.23 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.23
  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. "zlib>1.3.2"
  25. ENV GOGS_CUSTOM=/data/gogs
  26. # Configure LibC Name Service
  27. COPY docker/nsswitch.conf /etc/nsswitch.conf
  28. WORKDIR /app/gogs
  29. COPY docker ./docker
  30. COPY --from=binarybuilder /gogs.io/gogs/.bin/gogs .
  31. RUN ./docker/build/finalize.sh
  32. # Configure Docker Container
  33. VOLUME ["/data", "/backup"]
  34. EXPOSE 22 3000
  35. HEALTHCHECK CMD (curl --noproxy localhost -o /dev/null -sS http://localhost:3000/healthcheck) || exit 1
  36. ENTRYPOINT ["/app/gogs/docker/start.sh"]
  37. CMD ["/usr/bin/s6-svscan", "/app/gogs/docker/s6/"]