* Make arvados/passenger container
[arvados.git] / docker / api / Dockerfile
1 # Arvados API server Docker container.
2
3 FROM arvados/passenger
4 MAINTAINER Tim Pierce <twp@clinicalfuture.com>
5
6 # Install postgres and apache
7 RUN apt-get -q -y install procps postgresql postgresql-server-dev-9.1 apache2 \
8                           supervisor
9
10 RUN /bin/mkdir -p /usr/src/arvados/services
11 ADD generated/api.tar.gz /usr/src/arvados/services/
12
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
19
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 && \
27     rake db:setup && \
28     rake assets:precompile ; \
29     chown www-data:www-data config.ru ; \
30     chown www-data:www-data log -R
31
32 # Configure Apache and Passenger.
33 ADD passenger.conf /etc/apache2/conf.d/passenger
34 RUN a2dissite default ; \
35     a2ensite arvados ; \
36     a2enmod rewrite ; \
37     a2enmod ssl ; \
38     /bin/mkdir /var/run/apache2
39
40 # Supervisor.
41 ADD supervisor.conf /etc/supervisor/conf.d/arvados.conf
42 ADD apache2_foreground.sh /etc/apache2/foreground.sh
43
44 # Start the supervisor.
45 CMD ["/usr/bin/supervisord", "-n"]