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