From 76dcf6a13c5736ec15fb31fbc19c9eb8dee803a0 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 6 Sep 2018 12:26:06 +0200 Subject: initial build of gitlab image --- gitlab/Dockerfile | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 gitlab/Dockerfile (limited to 'gitlab/Dockerfile') diff --git a/gitlab/Dockerfile b/gitlab/Dockerfile new file mode 100644 index 0000000..17f2ee2 --- /dev/null +++ b/gitlab/Dockerfile @@ -0,0 +1,70 @@ +FROM alpine:3.8 + +ENV GITLAB_BRANCH 11-3-stable + +RUN apk add -U \ + build-base \ + zlib-dev \ + yaml-dev \ + libressl-dev \ + gdbm-dev \ + re2-dev \ + readline-dev \ + ncurses-dev \ + libffi-dev \ + curl-dev \ + openssh-server \ + libxml2-dev \ + libxslt-dev \ + icu-dev \ + logrotate \ + rsync \ + py-docutils \ + cmake \ + ruby=~2.5 \ + yarn \ + nodejs \ + sudo \ + git \ + go + +# create git user and config git +RUN addgroup -S git \ + && adduser -S -D -h /var/lib/git -s /bin/sh -G git -g git git \ + && sudo -u git -H git config --global core.autocrlf input \ + && sudo -u git -H git config --global gc.auto 0 \ + && sudo -u git -H git config --global repack.writeBitmaps true \ + && sudo -u git -H git config --global receive.advertisePushOptions true + +# clone gitlab repo +RUN cd /var/lib/git \ + && sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b $GITLAB_BRANCH gitlab + +# fix permissions +RUN cd /var/lib/git/gitlab \ + && chown -R git log/ tmp/ \ + && chmod -R u+rwX,go-w log/ \ + && chmod -R u+rwX tmp/ \ + && chmod -R u+rwX tmp/pids/ \ + && chmod -R u+rwX tmp/sockets/ \ + \ + && install -d -o git -g git -m0700 public/uploads \ + && chmod -R u+rwX builds/ \ + && chmod -R u+rwX shared/artifacts/ \ + && chmod -R ug+rwX shared/pages/ + + +# the following files may need to be edited for our config +RUN cd /var/lib/git/gitlab \ + && install -o git -g git config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb \ + && install -o git -g git config/gitlab.yml.example config/gitlab.yml \ + && install -o git -g git -m0600 config/secrets.yml.example config/secrets.yml \ + && install -o git -g git config/resque.yml.example config/resque.yml \ + && install -o git -g git config/unicorn.rb.example config/unicorn.rb \ + && install -o git -g git -m640 config/database.yml.postgresql config/database.yml + + + + + + -- cgit v1.2.3