FROM      arm32v7/ubuntu:18.04
  


ADD       resources/gogs_0.12.3_linux_armv7.tar.gz                    \
          /app
ADD       resources/start.sh                                          \
          /
ENV       GOGS_CUSTOM /data/gogs
ENV       DEBIAN_FRONTEND=noninteractive

RUN       addgroup git                                                \
     &&   adduser  --disabled-password                                \
            --gecos ""                                                \
            --home "/app/gogs"                                        \
            --ingroup "git"                                           \
            --no-create-home                                          \
            git                                                       \
     &&   mkdir /data                                                 \
     &&   chown -R git:git /app /data                                 \
     &&   ln -snf "/usr/share/zoneinfo/${TZ}"   /etc/localtime        \ 
     &&   echo "${TZ}"                         >/etc/timezone         \
     &&   apt update                                                  \
     &&   apt --yes install                                           \
            bash                                                      \
            ca-certificates                                           \
            curl                                                      \
            git                                                       \
            less                                                      \
            libcap2-bin                                               \
            musl-tools                                                \
            rsync                                                     \
            socat                                                     \
            sqlite                                                    \
            tzdata                                                    \
            vim                                                       \
     &&   chmod 755 /start.sh                                         \
     &&   echo "export GOGS_CUSTOM=${GOGS_CUSTOM}" >> /etc/profile



VOLUME       ["/data", "/backup"]

ENTRYPOINT   /start.sh

