2014-05-16 22:31:24 +00:00
|
|
|
FROM phusion/baseimage:0.9.10
|
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
ENV HOME /root
|
|
|
|
|
|
|
|
# Install the dependencies.
|
|
|
|
RUN apt-get update
|
|
|
|
|
|
|
|
# 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-dev libevent-dev gdebi-core g++ libmagic1
|
|
|
|
|
|
|
|
# PhantomJS
|
|
|
|
RUN apt-get install -y phantomjs
|
|
|
|
|
|
|
|
# Grunt
|
|
|
|
RUN apt-get install -y nodejs npm
|
|
|
|
RUN ln -s /usr/bin/nodejs /usr/bin/node
|
|
|
|
RUN npm install -g grunt-cli
|
|
|
|
|
2014-05-22 16:13:41 +00:00
|
|
|
# LDAP
|
|
|
|
RUN apt-get install -y libldap2-dev libsasl2-dev
|
|
|
|
|
2014-05-16 22:31:24 +00:00
|
|
|
ADD binary_dependencies binary_dependencies
|
|
|
|
RUN gdebi --n binary_dependencies/*.deb
|
|
|
|
|
|
|
|
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
|
|
|
|
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
|
|
|
# Add the static assets and run grunt
|
|
|
|
ADD grunt grunt
|
|
|
|
ADD static static
|
|
|
|
RUN cd grunt && npm install
|
|
|
|
RUN cd grunt && grunt
|
|
|
|
|
|
|
|
# Add the backend assets
|
2014-05-16 22:31:24 +00:00
|
|
|
ADD auth auth
|
|
|
|
ADD buildstatus buildstatus
|
|
|
|
ADD data data
|
|
|
|
ADD endpoints endpoints
|
|
|
|
ADD features features
|
|
|
|
ADD screenshots screenshots
|
|
|
|
ADD storage storage
|
|
|
|
ADD templates templates
|
|
|
|
ADD util util
|
|
|
|
ADD workers workers
|
|
|
|
|
|
|
|
ADD app.py app.py
|
|
|
|
ADD application.py application.py
|
|
|
|
ADD config.py config.py
|
|
|
|
ADD initdb.py initdb.py
|
2014-05-22 16:13:41 +00:00
|
|
|
ADD external_libraries.py external_libraries.py
|
|
|
|
ADD alembic.ini alembic.ini
|
|
|
|
|
|
|
|
# Add the config
|
|
|
|
ADD conf conf
|
|
|
|
RUN rm -rf /conf/stack
|
2014-05-16 22:31:24 +00:00
|
|
|
|
2014-05-18 21:19:14 +00:00
|
|
|
ADD conf/init/svlogd_config /svlogd_config
|
|
|
|
ADD conf/init/preplogsdir.sh /etc/my_init.d/
|
2014-05-22 16:13:41 +00:00
|
|
|
ADD conf/init/runmigration.sh /etc/my_init.d/
|
|
|
|
|
2014-05-18 21:19:14 +00:00
|
|
|
ADD conf/init/gunicorn /etc/service/gunicorn
|
|
|
|
ADD conf/init/nginx /etc/service/nginx
|
|
|
|
ADD conf/init/diffsworker /etc/service/diffsworker
|
|
|
|
ADD conf/init/webhookworker /etc/service/webhookworker
|
2014-05-16 22:31:24 +00:00
|
|
|
|
2014-05-22 16:13:41 +00:00
|
|
|
# Download any external libs.
|
|
|
|
RUN mkdir static/fonts
|
|
|
|
RUN mkdir static/ldn
|
|
|
|
|
|
|
|
RUN venv/bin/python -m external_libraries
|
2014-05-16 22:31:24 +00:00
|
|
|
|
|
|
|
# Add the tests last because they're prone to accidental changes, then run them
|
|
|
|
ADD test test
|
|
|
|
RUN TEST=true venv/bin/python -m unittest discover
|
|
|
|
|
|
|
|
RUN rm -rf /conf/stack
|
2014-05-22 16:13:41 +00:00
|
|
|
VOLUME ["/conf/stack", "/var/log", "/datastorage"]
|
2014-05-16 22:31:24 +00:00
|
|
|
|
|
|
|
EXPOSE 443 80
|
|
|
|
|
|
|
|
CMD ["/sbin/my_init"]
|