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 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/secret_token.rb /usr/src/arvados/services/api/config/initializers/secret_token.rb
22 ADD generated/omniauth.rb /usr/src/arvados/services/api/config/initializers/omniauth.rb
23 ADD generated/production.rb /usr/src/arvados/services/api/config/environments/production.rb
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 && \
40 chown www-data:www-data tmp -R
42 # Configure Apache and Passenger.
43 ADD passenger.conf /etc/apache2/conf.d/passenger
44 RUN a2dissite default && \
48 /bin/mkdir /var/run/apache2
51 ADD supervisor.conf /etc/supervisor/conf.d/arvados.conf
52 ADD apache2_foreground.sh /etc/apache2/foreground.sh
54 # Start the supervisor.
55 CMD ["/usr/bin/supervisord", "-n"]