2014-11-20 18:48:51 +00:00
|
|
|
# vim:ft=dockerfile
|
2014-12-18 16:53:10 +00:00
|
|
|
|
2015-09-01 15:43:08 +00:00
|
|
|
FROM phusion/baseimage:0.9.17
|
2014-05-16 22:31:24 +00:00
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
ENV HOME /root
|
|
|
|
|
|
|
|
# Install the dependencies.
|
2015-12-22 20:09:25 +00:00
|
|
|
RUN apt-get update # 22DEC2015
|
2014-05-16 22:31:24 +00:00
|
|
|
|
|
|
|
# New ubuntu packages should be added as their own apt-get install lines below the existing install commands
|
2015-02-05 22:15:17 +00:00
|
|
|
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 libgpgme11 libgpgme11-dev
|
2014-05-16 22:31:24 +00:00
|
|
|
|
2014-07-18 03:17:43 +00:00
|
|
|
# Build the python dependencies
|
|
|
|
ADD requirements.txt requirements.txt
|
|
|
|
RUN virtualenv --distribute venv
|
|
|
|
RUN venv/bin/pip install -r requirements.txt
|
2014-05-22 16:13:41 +00:00
|
|
|
|
2014-07-18 03:17:43 +00:00
|
|
|
# Install the binary dependencies
|
2014-05-16 22:31:24 +00:00
|
|
|
ADD binary_dependencies binary_dependencies
|
|
|
|
RUN gdebi --n binary_dependencies/*.deb
|
|
|
|
|
2014-11-05 17:45:14 +00:00
|
|
|
# Install Grunt
|
2014-07-18 03:17:43 +00:00
|
|
|
RUN ln -s /usr/bin/nodejs /usr/bin/node
|
|
|
|
RUN npm install -g grunt-cli
|
2014-05-16 22:31:24 +00:00
|
|
|
|
2014-11-05 17:45:14 +00:00
|
|
|
# Install Grunt depenencies
|
|
|
|
ADD grunt grunt
|
|
|
|
RUN cd grunt && npm install
|
|
|
|
|
2014-07-18 03:17:43 +00:00
|
|
|
# Add all of the files!
|
|
|
|
ADD . .
|
2014-05-16 22:31:24 +00:00
|
|
|
|
2014-07-18 03:17:43 +00:00
|
|
|
# Run grunt
|
2014-05-22 16:13:41 +00:00
|
|
|
RUN cd grunt && grunt
|
|
|
|
|
2015-11-20 20:03:56 +00:00
|
|
|
RUN apt-get remove -y --auto-remove python-dev g++ libjpeg62-dev libevent-dev libldap2-dev libsasl2-dev libpq-dev libffi-dev libgpgme11-dev nodejs npm
|
|
|
|
RUN apt-get autoremove -y
|
|
|
|
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
RUN rm -rf grunt
|
|
|
|
|
2015-08-10 17:39:39 +00:00
|
|
|
ADD conf/init/copy_config_files.sh /etc/my_init.d/
|
2014-08-25 18:23:21 +00:00
|
|
|
ADD conf/init/doupdatelimits.sh /etc/my_init.d/
|
2015-03-26 13:21:45 +00:00
|
|
|
ADD conf/init/copy_syslog_config.sh /etc/my_init.d/
|
2014-05-22 16:13:41 +00:00
|
|
|
ADD conf/init/runmigration.sh /etc/my_init.d/
|
2015-09-01 15:42:26 +00:00
|
|
|
ADD conf/init/syslog-ng.conf /etc/syslog-ng/
|
2015-10-26 23:06:05 +00:00
|
|
|
ADD conf/init/zz_boot.sh /etc/my_init.d/
|
2014-05-22 16:13:41 +00:00
|
|
|
|
2015-03-26 13:21:45 +00:00
|
|
|
ADD conf/init/service/ /etc/service/
|
|
|
|
|
|
|
|
RUN rm -rf /etc/service/syslog-forwarder
|
2014-07-31 17:30:54 +00:00
|
|
|
|
2014-05-22 16:13:41 +00:00
|
|
|
# Download any external libs.
|
2014-07-18 03:17:43 +00:00
|
|
|
RUN mkdir static/fonts static/ldn
|
2014-05-22 16:13:41 +00:00
|
|
|
RUN venv/bin/python -m external_libraries
|
2015-03-03 23:17:05 +00:00
|
|
|
RUN mkdir /usr/local/nginx/logs/
|
2014-05-16 22:31:24 +00:00
|
|
|
|
2015-09-16 22:25:01 +00:00
|
|
|
# TODO(ssewell): only works on a detached head, make work with ref
|
|
|
|
RUN cat .git/HEAD > GIT_HEAD
|
2015-09-16 15:44:58 +00:00
|
|
|
|
2014-07-18 03:17:43 +00:00
|
|
|
# Run the tests
|
2015-02-27 22:21:22 +00:00
|
|
|
RUN TEST=true venv/bin/python -m unittest discover -f
|
2015-05-29 22:08:17 +00:00
|
|
|
RUN TEST=true venv/bin/python -m test.registry_tests -f
|
2014-05-16 22:31:24 +00:00
|
|
|
|
2015-12-16 20:04:43 +00:00
|
|
|
RUN PYTHONPATH=. venv/bin/alembic heads | grep -E '^[0-9a-f]+ \(head\)$' > ALEMBIC_HEAD
|
2015-06-15 19:52:08 +00:00
|
|
|
|
2015-01-22 15:53:23 +00:00
|
|
|
VOLUME ["/conf/stack", "/var/log", "/datastorage", "/tmp", "/conf/etcd"]
|
2014-05-16 22:31:24 +00:00
|
|
|
|
2015-01-23 20:19:04 +00:00
|
|
|
EXPOSE 443 8443 80
|