# vim:ft=dockerfile ############################### # BEGIN COMMON SECION ############################### FROM phusion/baseimage:0.9.15 ENV DEBIAN_FRONTEND noninteractive ENV HOME /root # Install the dependencies. RUN apt-get update # 11DEC2014 # New ubuntu packages should be added as their own apt-get install lines below the existing install commands RUN apt-get install -y git python-virtualenv python-dev libjpeg8 libjpeg62 libjpeg62-dev libevent-2.0.5 libevent-dev gdebi-core g++ libmagic1 phantomjs nodejs npm libldap-2.4-2 libldap2-dev libsasl2-modules libsasl2-dev libpq5 libpq-dev libfreetype6-dev libffi-dev # Build the python dependencies ADD requirements.txt requirements.txt RUN virtualenv --distribute venv RUN venv/bin/pip install -r requirements.txt RUN apt-get remove -y --auto-remove python-dev g++ libjpeg62-dev libevent-dev libldap2-dev libsasl2-dev libpq-dev libffi-dev ############################### # END COMMON SECION ############################### # Remove SSH. RUN rm -rf /etc/service/sshd /etc/my_init.d/00_regen_ssh_host_keys.sh # Install the binary dependencies ADD binary_dependencies binary_dependencies RUN gdebi --n binary_dependencies/*.deb # Install Grunt RUN ln -s /usr/bin/nodejs /usr/bin/node RUN npm install -g grunt-cli # Install Grunt depenencies ADD grunt grunt RUN cd grunt && npm install # Add all of the files! ADD . . # Run grunt RUN cd grunt && grunt ADD conf/init/svlogd_config /svlogd_config ADD conf/init/doupdatelimits.sh /etc/my_init.d/ ADD conf/init/preplogsdir.sh /etc/my_init.d/ ADD conf/init/runmigration.sh /etc/my_init.d/ ADD conf/init/gunicorn_web /etc/service/gunicorn_web ADD conf/init/gunicorn_registry /etc/service/gunicorn_registry ADD conf/init/gunicorn_verbs /etc/service/gunicorn_verbs ADD conf/init/nginx /etc/service/nginx ADD conf/init/diffsworker /etc/service/diffsworker ADD conf/init/notificationworker /etc/service/notificationworker ADD conf/init/buildlogsarchiver /etc/service/buildlogsarchiver ADD conf/init/buildmanager /etc/service/buildmanager # Download any external libs. RUN mkdir static/fonts static/ldn RUN venv/bin/python -m external_libraries RUN apt-get autoremove -y RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Run the tests RUN TEST=true venv/bin/python -m unittest discover VOLUME ["/conf/stack", "/var/log", "/datastorage", "/tmp"] EXPOSE 443 80 CMD ["/sbin/my_init"]