Dockerfile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. from ubuntu:14.10
  2. run apt-get -y update
  3. run apt-get -y install software-properties-common
  4. run apt-get -y install python-software-properties &&\
  5. add-apt-repository ppa:chris-lea/node.js &&\
  6. apt-get -y update
  7. run apt-get -y install python-django-tagging python-simplejson python-memcache \
  8. python-ldap python-cairo python-django python-twisted \
  9. python-pysqlite2 python-support python-pip gunicorn \
  10. supervisor nginx-light nodejs git wget curl
  11. # Install statsd
  12. run mkdir /src && git clone https://github.com/etsy/statsd.git /src/statsd
  13. run cd /usr/local/src && git clone https://github.com/graphite-project/graphite-web.git
  14. run cd /usr/local/src && git clone https://github.com/graphite-project/carbon.git
  15. run cd /usr/local/src && git clone https://github.com/graphite-project/whisper.git
  16. run cd /usr/local/src/whisper && git checkout master && python setup.py install
  17. run cd /usr/local/src/carbon && git checkout 0.9.x && python setup.py install
  18. run cd /usr/local/src/graphite-web && git checkout 0.9.x && python check-dependencies.py; python setup.py install
  19. # statsd
  20. add ./files/statsd_config.js /src/statsd/config.js
  21. # Add graphite config
  22. add ./files/initial_data.json /opt/graphite/webapp/graphite/initial_data.json
  23. add ./files/local_settings.py /opt/graphite/webapp/graphite/local_settings.py
  24. add ./files/carbon.conf /opt/graphite/conf/carbon.conf
  25. add ./files/storage-schemas.conf /opt/graphite/conf/storage-schemas.conf
  26. add ./files/storage-aggregation.conf /opt/graphite/conf/storage-aggregation.conf
  27. add ./files/events_views.py /opt/graphite/webapp/graphite/events/views.py
  28. run mkdir -p /opt/graphite/storage/whisper
  29. run touch /opt/graphite/storage/graphite.db /opt/graphite/storage/index
  30. run chown -R www-data /opt/graphite/storage
  31. run chmod 0775 /opt/graphite/storage /opt/graphite/storage/whisper
  32. run chmod 0664 /opt/graphite/storage/graphite.db
  33. run cd /opt/graphite/webapp/graphite && python manage.py syncdb --noinput
  34. # Add system service config
  35. add ./files/nginx.conf /etc/nginx/nginx.conf
  36. add ./files/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
  37. # graphite
  38. expose 80
  39. # Carbon line receiver port
  40. expose 2003
  41. # Carbon cache query port
  42. expose 7002
  43. # Statsd UDP port
  44. expose 8125/udp
  45. # Statsd Management port
  46. expose 8126
  47. VOLUME ["/var/lib/elasticsearch"]
  48. VOLUME ["/opt/graphite/storage/whisper"]
  49. VOLUME ["/var/lib/log/supervisor"]
  50. cmd ["/usr/bin/supervisord"]
  51. # vim:ts=8:noet: