-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
executable file
·45 lines (35 loc) · 1.41 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
FROM ubuntu:14.04
ENV DEBIAN_FRONTEND=noninteractive
ENV MYSQL_ROOT_PASSWORD=cimetrics
ENV MYSQL_DATABASE=Metrics
ENV MYSQL_USER=cimetrics
ENV MYSQL_PASSWORD=cimetrics
RUN apt-get update
RUN apt-get -y install mysql-server
RUN apt-get -y install python-software-properties
RUN apt-get -y install php5-cli
RUN apt-get -y install php5-fpm
RUN apt-get -y install nginx
RUN apt-get -y install python-pip python-dev build-essential
RUN pip install django==1.6.5
RUN pip install ijson
RUN pip install uwsgi
RUN apt-get -y install libmysqlclient-dev
RUN pip install mysql-python
RUN pip install pymysql
RUN apt-get -y install git
RUN git clone https://github.com/openstack-hyper-v/CIMetricsAggregator.git /CIMetricsTool
EXPOSE 80
EXPOSE 8000
EXPOSE 8001
EXPOSE 3006
WORKDIR /CIMetricsTool/statsproj/openstack_stats
# Initialize the database.
RUN /etc/init.d/mysql start; mysql -e "create database Metrics; GRANT ALL PRIVILEGES ON Metrics.* TO cimetrics@localhost IDENTIFIED BY 'cimetrics'; FLUSH PRIVILEGES;"; python manage.py syncdb --noinput
# Setup the django superuser
RUN /etc/init.d/mysql start; echo "from django.contrib.auth.models import User; User.objects.create_superuser('root', 'admin@example.com', 'cimetrics')" | python manage.py shell
RUN apt-get -y install supervisor
RUN apt-get -y install upstart
RUN cp /CIMetricsTool/conf.d/nginx.conf /etc/nginx/sites-enabled/default
WORKDIR /CIMetricsTool/bin
CMD supervisord -n