summaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorThomas Boerger <tboerger@suse.de>2016-11-28 14:13:18 +0100
committerThomas Boerger <tboerger@suse.de>2016-11-28 14:13:18 +0100
commit86aa8e413acc1dbcc7760cb220a6ee2126e926b6 (patch)
tree9ed7aef2aa3c3306fdcb359d557e211c5f65f111 /Dockerfile
parentbf8d90c5cc6bea9ec4eeb2e827d10cd247043fe0 (diff)
downloadgitea-86aa8e413acc1dbcc7760cb220a6ee2126e926b6.tar.gz
gitea-86aa8e413acc1dbcc7760cb220a6ee2126e926b6.zip
Restructured docker building
I have restructured the docker build process entirely, the binary gets built outside of the docker build command, now we are managing all dependencies with real Alpine packages and I have dropped features like socat or the cron daemon. Signed-off-by: Thomas Boerger <tboerger@suse.de>
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile59
1 files changed, 42 insertions, 17 deletions
diff --git a/Dockerfile b/Dockerfile
index aa6c834e20..df363e07fb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,22 +1,47 @@
-FROM alpine:3.3
-MAINTAINER jp@roemer.im
+FROM alpine:edge
+MAINTAINER Thomas Boerger <thomas@webhippie.de>
-# Install system utils & Gogs runtime dependencies
-ADD https://github.com/tianon/gosu/releases/download/1.9/gosu-amd64 /usr/sbin/gosu
-RUN chmod +x /usr/sbin/gosu \
- && apk --no-cache --no-progress add ca-certificates bash git linux-pam s6 curl openssh socat tzdata
-
-ENV GITEA_CUSTOM /data/gogs
+EXPOSE 22 3000
-COPY . /app/gogs/
-WORKDIR /app/gogs/
-RUN ./docker/build.sh
+RUN echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
+ apk -U add \
+ gosu@testing \
+ shadow \
+ ca-certificates \
+ sqlite \
+ bash \
+ git \
+ linux-pam \
+ s6 \
+ curl \
+ openssh \
+ tzdata && \
+ rm -rf \
+ /var/cache/apk/* && \
+ groupadd \
+ -r \
+ -g 1000 \
+ git && \
+ useradd \
+ -r -M \
+ -p '*' \
+ -d /data/git \
+ -s /bin/bash \
+ -u 1000 \
+ -g git \
+ git
-# Configure LibC Name Service
-COPY docker/nsswitch.conf /etc/nsswitch.conf
+ENV USER git
+ENV GITEA_CUSTOM /data/gitea
+ENV GODEBUG=netdns=go
-# Configure Docker Container
VOLUME ["/data"]
-EXPOSE 22 3000
-ENTRYPOINT ["docker/start.sh"]
-CMD ["/bin/s6-svscan", "/app/gogs/docker/s6/"]
+
+ENTRYPOINT ["/usr/bin/entrypoint"]
+CMD ["/bin/s6-svscan", "/etc/s6"]
+
+COPY docker /
+
+COPY public /app/gitea/public
+COPY templates /app/gitea/templates
+COPY bin/gitea /app/gitea/gitea