1 # Arvados API server Docker container.
4 MAINTAINER Tim Pierce <twp@clinicalfuture.com>
6 # Install postgres and apache
7 RUN apt-get -q -y install procps postgresql postgresql-server-dev-9.1 apache2 \
10 RUN /bin/mkdir -p /usr/src/arvados/services
11 ADD generated/api.tar.gz /usr/src/arvados/services/
13 # Install generated config files
14 ADD generated/database.yml /usr/src/arvados/services/api/config/database.yml
15 ADD generated/secret_token.rb /usr/src/arvados/services/api/config/initializers/secret_token.rb
16 ADD generated/omniauth.rb /usr/src/arvados/services/api/config/initializers/omniauth.rb
17 ADD generated/production.rb /usr/src/arvados/services/api/config/environments/production.rb
18 ADD generated/apache2_vhost /etc/apache2/sites-available/arvados
20 # Configure Rails databases.
21 ENV RAILS_ENV production
22 ADD generated/config_databases.sh /tmp/config_databases.sh
23 RUN sh /tmp/config_databases.sh && \
24 rm /tmp/config_databases.sh && \
25 /etc/init.d/postgresql start && \
26 cd /usr/src/arvados/services/api && \
28 rake assets:precompile ; \
29 chown www-data:www-data config.ru ; \
30 chown www-data:www-data log -R
32 # Configure Apache and Passenger.
33 ADD passenger.conf /etc/apache2/conf.d/passenger
34 RUN a2dissite default ; \
38 /bin/mkdir /var/run/apache2
41 ADD supervisor.conf /etc/supervisor/conf.d/arvados.conf
42 ADD apache2_foreground.sh /etc/apache2/foreground.sh
44 # Start the supervisor.
45 CMD ["/usr/bin/supervisord", "-n"]