Dockerfile 959 B

123456789101112131415161718192021222324252627282930
  1. FROM alpine:3.2
  2. MAINTAINER roemer.jp@gmail.com
  3. # Install system utils & Gogs runtime dependencies
  4. ADD https://github.com/tianon/gosu/releases/download/1.5/gosu-amd64 /usr/sbin/gosu
  5. RUN echo "@edge http://dl-4.alpinelinux.org/alpine/edge/main" | tee -a /etc/apk/repositories \
  6. && echo "@community http://dl-4.alpinelinux.org/alpine/edge/community" | tee -a /etc/apk/repositories \
  7. && apk -U --no-progress upgrade \
  8. && apk -U --no-progress add ca-certificates bash git linux-pam s6@edge curl openssh socat \
  9. && chmod +x /usr/sbin/gosu
  10. # Configure Go and build Gogs
  11. ENV GOPATH /tmp/go
  12. ENV PATH $PATH:$GOPATH/bin
  13. COPY . /app/gogs/
  14. WORKDIR /app/gogs/
  15. RUN ./docker/build.sh
  16. ENV GOGS_CUSTOM /data/gogs
  17. # Create git user for Gogs
  18. RUN adduser -D -g 'Gogs Git User' git -h /data/git/ -s /bin/sh && passwd -u git
  19. RUN echo "export GOGS_CUSTOM=/data/gogs" >> /etc/profile
  20. # Configure Docker Container
  21. VOLUME ["/data"]
  22. EXPOSE 22 3000
  23. CMD ["./docker/start.sh"]