Dockerfile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. from ubuntu:14.04
  2. run apt-get -y update
  3. run apt-get -y install libcairo2-dev libffi-dev pkg-config python-dev python-pip fontconfig apache2 libapache2-mod-wsgi git-core collectd memcached gcc g++ make supervisor nginx-light gunicorn
  4. run cd /usr/local/src && git clone https://github.com/graphite-project/graphite-web.git
  5. run cd /usr/local/src && git clone https://github.com/graphite-project/carbon.git
  6. run cd /usr/local/src && git clone https://github.com/graphite-project/whisper.git
  7. run cd /usr/local/src/whisper && git checkout master && python setup.py install
  8. run cd /usr/local/src/carbon && git checkout 0.9.x && pip install -r requirements.txt; python setup.py install
  9. run cd /usr/local/src/graphite-web && git checkout 0.9.x && pip install -r requirements.txt; python check-dependencies.py; python setup.py install
  10. # Add graphite config
  11. add ./files/initial_data.json /opt/graphite/webapp/graphite/initial_data.json
  12. add ./files/local_settings.py /opt/graphite/webapp/graphite/local_settings.py
  13. add ./files/carbon.conf /opt/graphite/conf/carbon.conf
  14. add ./files/storage-schemas.conf /opt/graphite/conf/storage-schemas.conf
  15. add ./files/storage-aggregation.conf /opt/graphite/conf/storage-aggregation.conf
  16. add ./files/events_views.py /opt/graphite/webapp/graphite/events/views.py
  17. run mkdir -p /opt/graphite/storage/whisper
  18. run touch /opt/graphite/storage/graphite.db /opt/graphite/storage/index
  19. run chown -R www-data /opt/graphite/storage
  20. run chmod 0775 /opt/graphite/storage /opt/graphite/storage/whisper
  21. run chmod 0664 /opt/graphite/storage/graphite.db
  22. run cd /opt/graphite/webapp/graphite && python manage.py syncdb --noinput
  23. add ./files/my_htpasswd /etc/nginx/.htpasswd
  24. # Add system service config
  25. add ./files/nginx.conf /etc/nginx/nginx.conf
  26. add ./files/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
  27. # Nginx
  28. #
  29. # graphite
  30. expose 80
  31. # Carbon line receiver port
  32. expose 2003
  33. # Carbon cache query port
  34. expose 7002
  35. VOLUME ["/opt/graphite/storage/whisper"]
  36. VOLUME ["/var/lib/log/supervisor"]
  37. cmd ["/usr/bin/supervisord"]
  38. # vim:ts=8:noet: