Dockerfile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. FROM golang:alpine AS builder
  2. MAINTAINER "Yoginth <yoginth@icloud.com>"
  3. # Install build deps
  4. RUN apk --no-cache --no-progress add --virtual build-deps build-base git linux-pam-dev
  5. WORKDIR /go/src/gitote/gitote
  6. COPY . .
  7. RUN make build TAGS="sqlite cert pam"
  8. FROM alpine:latest
  9. # Install system utils & Gitote runtime dependencies
  10. ADD https://github.com/tianon/gosu/releases/download/1.10/gosu-amd64 /usr/sbin/gosu
  11. RUN chmod +x /usr/sbin/gosu \
  12. && echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories \
  13. && apk --no-cache --no-progress add \
  14. bash \
  15. ca-certificates \
  16. curl \
  17. git \
  18. linux-pam \
  19. openssh \
  20. s6 \
  21. shadow \
  22. socat \
  23. tzdata
  24. ENV GITOTE_CUSTOM /data/gitote
  25. # Configure LibC Name Service
  26. COPY docker/nsswitch.conf /etc/nsswitch.conf
  27. WORKDIR /app/gitote
  28. COPY docker ./docker
  29. COPY templates ./templates
  30. COPY public ./public
  31. COPY --from=builder /go/src/gitote/gitote .
  32. RUN ./docker/finalize.sh
  33. # Configure Docker Container
  34. VOLUME ["/data"]
  35. EXPOSE 22 3000
  36. ENTRYPOINT ["/app/gitote/docker/start.sh"]
  37. CMD ["/bin/s6-svscan", "/app/gitote/docker/s6/"]