1 # Arvados API server Docker container.
4 MAINTAINER Tim Pierce <twp@curoverse.com>
6 # Install postgres and apache.
7 # Clone a git repository of Arvados source -- not used to build, but
8 # will be used by the Commit model and anything else that needs to
9 # check a git repo for crunch scripts.
11 RUN apt-get update && \
12 apt-get -q -y install procps postgresql postgresql-server-dev-9.1 apache2 \
14 git clone --bare git://github.com/curoverse/arvados.git /var/cache/git/arvados.git
16 RUN /bin/mkdir -p /usr/src/arvados/services
17 ADD generated/api.tar.gz /usr/src/arvados/services/
19 # Install generated config files
20 ADD generated/database.yml /usr/src/arvados/services/api/config/database.yml
21 ADD generated/omniauth.rb /usr/src/arvados/services/api/config/initializers/omniauth.rb
22 RUN /bin/cp /usr/src/arvados/services/api/config/environments/production.rb.example /usr/src/arvados/services/api/config/environments/production.rb
23 ADD generated/application.yml /usr/src/arvados/services/api/config/application.yml
24 ADD generated/apache2_vhost /etc/apache2/sites-available/arvados
26 # Configure Rails databases.
27 ENV RAILS_ENV production
28 ADD generated/config_databases.sh /tmp/config_databases.sh
29 ADD generated/superuser_token /tmp/superuser_token
30 RUN bundle install --gemfile=/usr/src/arvados/services/api/Gemfile && \
31 sh /tmp/config_databases.sh && \
32 rm /tmp/config_databases.sh && \
33 /etc/init.d/postgresql start && \
34 cd /usr/src/arvados/services/api && \
36 rake assets:precompile && \
37 ./script/create_superuser_token.rb $(cat /tmp/superuser_token) && \
38 chown www-data:www-data config.ru && \
39 chown www-data:www-data log -R && \
41 chown www-data:www-data tmp -R
43 # Configure Apache and Passenger.
44 ADD passenger.conf /etc/apache2/conf.d/passenger
45 RUN a2dissite default && \
49 /bin/mkdir /var/run/apache2
52 ADD supervisor.conf /etc/supervisor/conf.d/arvados.conf
53 ADD apache2_foreground.sh /etc/apache2/foreground.sh
55 # Start the supervisor.
56 CMD ["/usr/bin/supervisord", "-n"]