Andy Bavier | e4b346e | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 1 | FROM ubuntu:14.04.1 |
| 2 | MAINTAINER Andy Bavier <acb@cs.princeton.edu> |
| 3 | |
| 4 | # Install. |
| 5 | RUN apt-get update |
Andy Bavier | 58be41f | 2015-02-10 16:37:33 -0500 | [diff] [blame^] | 6 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y git |
| 7 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql |
| 8 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-psycopg2 |
| 9 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y graphviz graphviz-dev |
| 10 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libxslt1.1 libxslt1-dev |
| 11 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-pip |
| 12 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tar |
| 13 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y gcc |
| 14 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-httplib2 |
| 15 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y geoip-database libgeoip1 |
| 16 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget |
| 17 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-dev |
| 18 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libyaml-dev |
Andy Bavier | e4b346e | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 19 | |
| 20 | RUN pip install django==1.7 |
| 21 | RUN pip install djangorestframework==2.4.4 |
| 22 | RUN pip install markdown # Markdown support for the browseable API. |
| 23 | RUN pip install pyyaml # YAML content-type support. |
| 24 | RUN pip install django-filter # Filtering support |
| 25 | RUN pip install lxml # XML manipulation library |
| 26 | RUN pip install netaddr # IP Addr library |
| 27 | RUN pip install pytz |
| 28 | RUN pip install django-timezones |
| 29 | RUN pip install requests |
| 30 | RUN pip install django-crispy-forms |
| 31 | RUN pip install django-geoposition |
| 32 | RUN pip install django-extensions |
| 33 | RUN pip install django-suit |
| 34 | RUN pip install django-evolution |
| 35 | RUN pip install django-bitfield |
| 36 | RUN pip install django-ipware |
| 37 | RUN pip install django-encrypted-fields |
| 38 | RUN pip install python-keyczar |
| 39 | |
Andy Bavier | 58be41f | 2015-02-10 16:37:33 -0500 | [diff] [blame^] | 40 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-keystoneclient |
| 41 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-novaclient |
| 42 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-neutronclient |
| 43 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-glanceclient |
| 44 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-ceilometerclient |
Andy Bavier | e4b346e | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 45 | |
| 46 | RUN pip install django_rest_swagger |
| 47 | |
Andy Bavier | 58be41f | 2015-02-10 16:37:33 -0500 | [diff] [blame^] | 48 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-setuptools |
Andy Bavier | e4b346e | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 49 | RUN easy_install django_evolution |
| 50 | RUN easy_install python_gflags |
| 51 | RUN easy_install google_api_python_client |
| 52 | |
| 53 | # Set up latest Ansible |
| 54 | # Need to add our patches too |
Andy Bavier | 58be41f | 2015-02-10 16:37:33 -0500 | [diff] [blame^] | 55 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y ansible |
Andy Bavier | e4b346e | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 56 | # RUN git clone --recursive git://github.com/ansible/ansible.git /opt/ansible |
| 57 | ADD ansible-hosts /etc/ansible/hosts |
| 58 | |
| 59 | ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/ |
| 60 | |
Andy Bavier | 4373b95 | 2015-02-10 14:01:07 -0500 | [diff] [blame] | 61 | # For Observer |
| 62 | RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum |
| 63 | RUN cd /tmp/fofum; python setup.py install |
| 64 | |
Andy Bavier | e4b346e | 2015-02-06 16:39:06 -0500 | [diff] [blame] | 65 | # Get XOS |
| 66 | ADD planetstack /opt/xos |
| 67 | |
| 68 | ADD observer-initscript /etc/init.d/plstackobserver |
| 69 | |
| 70 | RUN chmod +x /opt/xos/scripts/opencloud |
| 71 | RUN /opt/xos/scripts/opencloud genkeys |
| 72 | |
| 73 | # Set postgres password to match default value in settings.py |
| 74 | RUN service postgresql start; sudo -u postgres psql -c "alter user postgres with password 'password';" |
| 75 | |
| 76 | # Turn DEBUG on so that devel server will serve static files |
| 77 | RUN sed -i 's/DEBUG = False/DEBUG = True/' /opt/xos/planetstack/settings.py |
| 78 | |
| 79 | # Cruft to workaround problems with migrations, should go away... |
| 80 | RUN /opt/xos/scripts/opencloud dropdb |
| 81 | RUN rm -rf /opt/xos/*/migrations |
| 82 | RUN cd /opt/xos; python ./manage.py makemigrations core |
| 83 | RUN cd /opt/xos; python ./manage.py makemigrations hpc |
| 84 | RUN cd /opt/xos; python ./manage.py makemigrations requestrouter |
| 85 | RUN cd /opt/xos; python ./manage.py makemigrations syndicate_storage |
| 86 | RUN cd /opt/xos; python ./manage.py makemigrations servcomp |
| 87 | |
| 88 | RUN /opt/xos/scripts/opencloud initdb |
| 89 | |
| 90 | EXPOSE 8000 |
| 91 | |
| 92 | # Set environment variables. |
| 93 | ENV HOME /root |
| 94 | |
| 95 | # Define working directory. |
| 96 | WORKDIR /root |
| 97 | |
| 98 | # Define default command. |
| 99 | CMD ["/bin/bash"] |