46 lines
1.5 KiB
Docker
46 lines
1.5 KiB
Docker
FROM cloudron/base:0.8.0
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y openssh-server && \
|
|
rm -r /var/cache/apt /var/lib/apt/lists
|
|
|
|
ADD supervisor/ /etc/supervisor/conf.d/
|
|
|
|
ENV GOROOT /usr/local/go-1.5.1
|
|
ENV PATH $GOROOT/bin:$PATH
|
|
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/gogits/gogs.git && \
|
|
cd gogs && \
|
|
git reset --hard b2fb7e3fd27f360e65ee60b93cad7d5d9832f818 && \
|
|
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}
|
|
|
|
# setup config paths
|
|
ADD app.ini.template /home/cloudron/app.ini.template
|
|
RUN mkdir -p /run/gogs && chown -R cloudron:cloudron /run/gogs
|
|
|
|
# setup log paths
|
|
RUN mkdir -p /run/gogs && chown -R cloudron:cloudron /run/gogs
|
|
RUN sed -e 's,^logfile=.*$,logfile=/run/gogs/supervisord.log,' -i /etc/supervisor/supervisord.conf
|
|
|
|
RUN ln -s /app/data/ssh /home/cloudron/.ssh
|
|
RUN ln -s /app/data/gitconfig /home/cloudron/.gitconfig
|
|
|
|
ADD start.sh /home/cloudron/start.sh
|
|
|
|
# disable pam authentication for sshd
|
|
RUN sed -e 's/UsePAM yes/UsePAM no/' -e 's/UsePrivilegeSeparation yes/UsePrivilegeSeparation no/' -i /etc/ssh/sshd_config
|
|
RUN echo "UseDNS no" >> /etc/ssh/sshd_config
|
|
|
|
CMD [ "/home/cloudron/start.sh" ]
|
|
|