From 6d7bd395f390964fe0bbdfc410127ca5df37f9ac Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 24 Jun 2015 14:26:43 -0700 Subject: [PATCH] Build from source again since we need patches --- Dockerfile | 20 +++++++++++++++----- start.sh | 4 ++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index a302e8b..345f234 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,11 +6,21 @@ RUN apt-get update && \ ADD supervisor/ /etc/supervisor/conf.d/ -RUN cd /tmp && \ - wget https://github.com/gogits/gogs/releases/download/v0.6.1/linux_amd64.zip && \ - unzip linux_amd64.zip -d /home/cloudron && \ - chown -R cloudron:cloudron /home/cloudron/gogs && \ - rm linux_amd64.zip +ENV GOPATH /home/cloudron/gows +RUN mkdir -p /home/cloudron/gows /home/cloudron/gogs + +## TODO: use redis as well +RUN mkdir -p ${GOPATH}/src/github.com/gogits && \ + cd ${GOPATH}/src/github.com/gogits && \ + git clone https://github.com/cloudron-io/gogs.git && \ + cd gogs && \ + go get ./... && \ + go build && \ + go install && \ + mv ${GOPATH}/bin/gogs /home/cloudron/gogs/ && \ + cp -r ${GOPATH}/src/github.com/gogits/gogs/templates/ /home/cloudron/gogs/. && \ + cp -r ${GOPATH}/src/github.com/gogits/gogs/public/ /home/cloudron/gogs/. && \ + rm -rf ${GOPATH} ADD app.ini.template /home/cloudron/app.ini.template ADD start.sh /home/cloudron/start.sh diff --git a/start.sh b/start.sh index 0be7494..d18b20f 100755 --- a/start.sh +++ b/start.sh @@ -6,6 +6,10 @@ fqdn=$(hostname -f) chown -R cloudron.cloudron /app/data +# clean up old logs +rm -rf /home/cloudron/gogs/log && mkdir -p /home/cloudron/gogs/log +chown cloudron:cloudron /home/cloudron/gogs/log + # Dockerfile changes the ownership of this file to make it writable by cloudron user sed -e "s/^Port .*/Port ${SSH_PORT}/" \ -e "s/^#ListenAddress .*/ListenAddress 0.0.0.0/" \