Merge branch '1579-keep-server-in-docker' of git.clinicalfuture.com:arvados into...
[arvados.git] / docker / api / Dockerfile
1 # Arvados API server Docker container.
2
3 FROM arvados/base
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     libcurl4-openssl-dev apache2-threaded-dev libapr1-dev libaprutil1-dev \
9     supervisor
10
11 RUN /bin/mkdir -p /usr/src/arvados/services
12 ADD generated/api.tar.gz /usr/src/arvados/services/
13
14 # Install gems needed for API server
15 RUN bundle install --gemfile=/usr/src/arvados/services/api/Gemfile
16
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
23
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 && \
31     rake db:setup && \
32     rake assets:precompile
33
34 # Configure Apache and Passenger.
35 ADD passenger.conf /etc/apache2/conf.d/passenger
36 RUN a2dissite default && \
37     a2ensite arvados && \
38     a2enmod rewrite && \
39     a2enmod ssl && \
40     /bin/mkdir /var/run/apache2 && \
41     passenger-install-apache2-module --auto
42
43 # Supervisor.
44 ADD supervisor.conf /etc/supervisor/conf.d/arvados.conf
45 ADD apache2_foreground.sh /etc/apache2/foreground.sh
46
47 # Start the supervisor.
48 CMD ["/usr/bin/supervisord", "-n"]