summaryrefslogtreecommitdiff
path: root/Dockerfile
blob: 693e513064ae6d95e0f799200c09198f95678631 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM ubuntu:12.04
MAINTAINER Sytse Sijbrandij

# Setup a production GitLab container
# with the official GitLab cookbook
# https://gitlab.com/gitlab-org/cookbook-gitlab/blob/master/README.md

# Build with: sudo docker build -t gitlab .

EXPOSE 22
EXPOSE 80

RUN apt-get -y update
RUN apt-get -y install curl build-essential libxml2-dev libxslt-dev git

# Suppress Upstart and init.d errors
# http://lalyos.github.io/blog/2013/10/01/fixing-startup-on-docker/
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -s /bin/true /sbin/initctl

# Thanks to Paul Czarkowski "paul@paulcz.net" for
# http://tech.paulcz.net/2013/09/creating-immutable-servers-with-chef-and-docker-dot-io.html
ADD https://www.opscode.com/chef/install.sh install.sh
RUN bash ./install.sh -v 11.4.4
RUN echo "gem: --no-ri --no-rdoc" > ~/.gemrc
RUN /opt/chef/embedded/bin/gem install berkshelf

# Reuse the solo.json from the cookbook, customize this to change settings
ADD https://gitlab.com/gitlab-org/cookbook-gitlab/raw/master/solo.json.production_example /chef/solo.json
# Copy solo.rb, Berksfile, etc.
ADD . /chef

RUN cd /chef && /opt/chef/embedded/bin/berks install --path /chef/cookbooks
RUN chef-solo -c /chef/solo.rb -j /chef/solo.json

# TODO start all the services with a script (gitlab, redis, postgresql, nginx)