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 \
8 libcurl4-openssl-dev apache2-threaded-dev libapr1-dev libaprutil1-dev \
11 # Install gems needed for API server
12 RUN bundle install --gemfile=/usr/src/arvados/services/api/Gemfile
14 # Install generated config files
15 ADD generated/database.yml /usr/src/arvados/services/api/config/database.yml
16 ADD generated/secret_token.rb /usr/src/arvados/services/api/config/initializers/secret_token.rb
17 ADD generated/omniauth.rb /usr/src/arvados/services/api/config/initializers/omniauth.rb
18 ADD generated/production.rb /usr/src/arvados/services/api/config/environments/production.rb
19 ADD generated/apache2_vhost /etc/apache2/sites-available/arvados
21 # Configure databases and users.
22 ADD generated/config_databases.sh /tmp/config_databases.sh
23 RUN sh /tmp/config_databases.sh ; \
24 rm /tmp/config_databases.sh
26 # Set up the Rails database. This has to be done in a script so that
27 # postgres can run in the background while running rake db:setup.
28 ENV RAILS_ENV production
29 ADD config_rake.sh /tmp/config_rake.sh
30 RUN sh /tmp/config_rake.sh ; \
31 rm /tmp/config_rake.sh
33 # Configure Apache and Passenger.
34 ADD passenger.conf /etc/apache2/conf.d/passenger
35 RUN a2dissite default ; \
38 passenger-install-apache2-module --auto
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"]