Fix test for LdapGroup#memberships_modifiable_by?
[gitorious.git] / Dockerfile
blobcf23ef2f402ba22215df92b3ffc229df5f2b3853
1 FROM ubuntu:14.04
2 MAINTAINER Marcin Kulik
4 ENV DEBIAN_FRONTEND noninteractive
6 RUN apt-get -y update
8 # install required packages
9 RUN apt-get -y install git build-essential libmysqlclient-dev libxml2-dev \
10   libxslt1-dev libreadline6 libicu-dev imagemagick nodejs sudo mysql-client \
11   nginx cmake pkg-config sphinxsearch
13 # install Ruby 2.0 and make it a default Ruby
14 RUN apt-get install -y ruby2.0 ruby2.0-dev
15 RUN rm /usr/bin/ruby /usr/bin/gem /usr/bin/irb /usr/bin/erb && \
16   ln -s /usr/bin/ruby2.0 /usr/bin/ruby && \
17   ln -s /usr/bin/gem2.0 /usr/bin/gem && \
18   ln -s /usr/bin/irb2.0 /usr/bin/irb && \
19   ln -s /usr/bin/erb2.0 /usr/bin/erb && \
20   gem update --system && gem pristine --all
22 # install bundler
23 RUN gem install bundler --no-rdoc --no-ri
25 # create directory for app files
26 RUN mkdir -p /usr/src/app
27 WORKDIR /usr/src/app
29 # add Gemfile first and run `bundle install` system-wide so bundle result can be cached
30 ADD Gemfile /usr/src/app/
31 ADD Gemfile.lock /usr/src/app/
32 RUN bundle install --system --without postgres --jobs 4
34 # now add the rest of the app to the image
35 ADD . /usr/src/app
37 # make sure all Rails processes run in production env by default
38 ENV RAILS_ENV production
40 # build assets
41 RUN bundle exec rake assets:precompile
42 RUN git submodule update --recursive --init
44 # put revision (git sha) and version (tag + sha) into public/
45 RUN git rev-parse HEAD >public/REVISION && git describe --tags HEAD >public/VERSION
47 # add git user (with uid matching the uid of git user on the host)
48 RUN useradd -m -d /home/git -u 5000 -U git
50 # own app files to git so it can write to config, log and tmp when container is run as git
51 RUN chown -R git:git /usr/src/app
53 RUN ln -sf /usr/src/app/config/docker/nginx/nginx.conf /etc/nginx/nginx.conf
55 EXPOSE 3000
56 EXPOSE 80
57 EXPOSE 9312
59 ENTRYPOINT ["/usr/src/app/bin/docker/run"]
61 CMD ["bundle", "exec", "unicorn", "-c", "config/unicorn.rb"]