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 RUN /bin/mkdir -p /usr/src/arvados/services
12 ADD generated/api.tar.gz /usr/src/arvados/services/
14 # Install gems needed for API server
15 RUN bundle install --gemfile=/usr/src/arvados/services/api/Gemfile
17 # Install generated config files
18 ADD generated/database.yml /usr/src/arvados/services/api/config/database.yml
19 ADD generated/secret_token.rb /usr/src/arvados/services/api/config/initializers/secret_token.rb
20 ADD generated/omniauth.rb /usr/src/arvados/services/api/config/initializers/omniauth.rb
21 ADD generated/production.rb /usr/src/arvados/services/api/config/environments/production.rb
22 ADD generated/apache2_vhost /etc/apache2/sites-available/arvados
24 # Configure Rails databases.
25 ENV RAILS_ENV production
26 ADD generated/config_databases.sh /tmp/config_databases.sh
27 RUN sh /tmp/config_databases.sh && \
28 rm /tmp/config_databases.sh && \
29 /etc/init.d/postgresql start && \
30 cd /usr/src/arvados/services/api && \
32 rake assets:precompile
34 # Configure Apache and Passenger.
35 ADD passenger.conf /etc/apache2/conf.d/passenger
36 RUN a2dissite default && \
40 /bin/mkdir /var/run/apache2 && \
41 passenger-install-apache2-module --auto
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"]