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 sh /tmp/config_databases.sh && \
31 rm /tmp/config_databases.sh && \
32 /etc/init.d/postgresql start && \
33 cd /usr/src/arvados/services/api && \
35 rake assets:precompile && \
36 ./script/create_superuser_token.rb $(cat /tmp/superuser_token) && \
37 chown www-data:www-data config.ru && \
38 chown www-data:www-data log -R && \
39 chown www-data:www-data tmp -R
41 # Configure Apache and Passenger.
42 ADD passenger.conf /etc/apache2/conf.d/passenger
43 RUN a2dissite default && \
47 /bin/mkdir /var/run/apache2
50 ADD supervisor.conf /etc/supervisor/conf.d/arvados.conf
51 ADD apache2_foreground.sh /etc/apache2/foreground.sh
53 # Start the supervisor.
54 CMD ["/usr/bin/supervisord", "-n"]