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