mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-04-17 11:56:48 +02:00
update graphite
This commit is contained in:
parent
37127da205
commit
aa3b8728b9
@ -8,7 +8,8 @@ MAINTAINER EasyPi Software Foundation
|
|||||||
ENV GRAPHITE_VERSION=1.1.7
|
ENV GRAPHITE_VERSION=1.1.7
|
||||||
ENV GRAPHITE_CONF_DIR=/opt/graphite/conf
|
ENV GRAPHITE_CONF_DIR=/opt/graphite/conf
|
||||||
ENV GRAPHITE_STORAGE_DIR=/opt/graphite/storage
|
ENV GRAPHITE_STORAGE_DIR=/opt/graphite/storage
|
||||||
ENV PATH=$PATH:/opt/graphite/bin
|
ENV DJANGO_SETTINGS_MODULE=graphite.settings
|
||||||
|
ENV PATH=/opt/graphite/bin:$PATH
|
||||||
ENV PYTHONPATH=/opt/graphite/lib:/opt/graphite/webapp
|
ENV PYTHONPATH=/opt/graphite/lib:/opt/graphite/webapp
|
||||||
|
|
||||||
WORKDIR /opt/graphite
|
WORKDIR /opt/graphite
|
||||||
@ -18,32 +19,36 @@ RUN set -xe \
|
|||||||
&& apk add build-base \
|
&& apk add build-base \
|
||||||
cairo \
|
cairo \
|
||||||
curl \
|
curl \
|
||||||
git \
|
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
python \
|
nginx \
|
||||||
python-dev \
|
python3 \
|
||||||
&& curl -sSL https://bootstrap.pypa.io/get-pip.py | python \
|
python3-dev \
|
||||||
&& pip install gunicorn scandir supervisor whisper==$GRAPHITE_VERSION \
|
&& curl -sSL https://bootstrap.pypa.io/get-pip.py | python3 \
|
||||||
&& pip install -r https://github.com/graphite-project/graphite-web/raw/$GRAPHITE_VERSION/requirements.txt \
|
&& pip3 install gunicorn supervisor \
|
||||||
&& pip install carbon==$GRAPHITE_VERSION --install-option="--install-lib=/opt/graphite/lib" \
|
&& pip3 install --install-option=--prefix=/opt/graphite \
|
||||||
&& pip install graphite-web==$GRAPHITE_VERSION --install-option="--prefix=/opt/graphite" --install-option="--install-lib=/opt/graphite/webapp" \
|
--install-option=--install-lib=/opt/graphite/lib \
|
||||||
&& cd conf \
|
whisper==$GRAPHITE_VERSION \
|
||||||
|
carbon==$GRAPHITE_VERSION \
|
||||||
|
&& pip3 install --install-option=--prefix=/opt/graphite \
|
||||||
|
--install-option=--install-lib=/opt/graphite/webapp \
|
||||||
|
graphite-web==$GRAPHITE_VERSION \
|
||||||
|
&& cd ./webapp \
|
||||||
|
&& echo "SECRET_KEY = '$(head -c 16 /dev/urandom | base64)'" >> graphite/local_settings.py \
|
||||||
|
&& cd ../conf \
|
||||||
&& cp carbon.conf.example carbon.conf \
|
&& cp carbon.conf.example carbon.conf \
|
||||||
&& cp storage-schemas.conf.example storage-schemas.conf \
|
&& cp storage-schemas.conf.example storage-schemas.conf \
|
||||||
&& cd ../webapp \
|
&& cp aggregation-rules.conf.example aggregation-rules.conf \
|
||||||
&& echo "SECRET_KEY = '$(head -c 16 /dev/urandom | base64)'" > graphite/local_settings.py \
|
&& cd .. \
|
||||||
&& curl -sSL https://github.com/graphite-project/graphite-web/raw/master/webapp/manage.py > manage.py \
|
&& django-admin collectstatic --noinput \
|
||||||
&& chmod +x manage.py \
|
&& django-admin migrate --noinput --run-syncdb \
|
||||||
&& ./manage.py collectstatic --noinput --settings=graphite.settings \
|
|
||||||
&& ./manage.py migrate --noinput --run-syncdb \
|
|
||||||
&& apk del build-base \
|
&& apk del build-base \
|
||||||
curl \
|
curl \
|
||||||
git \
|
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
python-dev \
|
python-dev \
|
||||||
&& rm -rf /root/.cache/pip \
|
&& rm -rf /root/.cache/pip \
|
||||||
/var/cache/apk/*
|
/var/cache/apk/*
|
||||||
|
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
COPY supervisord.conf /etc/supervisor/
|
COPY supervisord.conf /etc/supervisor/
|
||||||
|
|
||||||
VOLUME $GRAPHITE_CONF_DIR \
|
VOLUME $GRAPHITE_CONF_DIR \
|
||||||
|
@ -24,26 +24,32 @@ graphite:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./data/conf:/opt/graphite/conf
|
- ./data/conf:/opt/graphite/conf
|
||||||
- ./data/storage:/opt/graphite/storage
|
- ./data/storage:/opt/graphite/storage
|
||||||
restart: always
|
- ./data/storage/log/webapp:/opt/graphite/storage/log/webapp
|
||||||
|
restart: unless-stopped
|
||||||
```
|
```
|
||||||
|
|
||||||
## Up and Running
|
## Up and Running
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd ~/fig/graphite
|
$ cd ~/fig/graphite
|
||||||
$ mkdir -p data/storage/log/webapp
|
|
||||||
|
$ docker-compose run --rm graphite sh
|
||||||
|
>>> django-admin migrate --noinput --run-syncdb
|
||||||
|
>>> django-admin createsuperuser
|
||||||
|
>>> django-admin changepassword
|
||||||
|
>>> exit
|
||||||
|
|
||||||
$ docker-compose up -d
|
$ docker-compose up -d
|
||||||
|
|
||||||
$ docker-compose exec graphite sh
|
$ docker-compose exec graphite sh
|
||||||
>>> vi conf/storage-schemas.conf
|
>>> vi conf/storage-schemas.conf
|
||||||
>>> python webapp/manage.py migrate --noinput --run-syncdb
|
>>> supervisorctl restart all
|
||||||
>>> python webapp/manage.py createsuperuser
|
|
||||||
>>> python webapp/manage.py changepassword
|
|
||||||
>>> supervisorctl restart
|
|
||||||
>>> supervisorctl status
|
>>> supervisorctl status
|
||||||
carbon-aggregator RUNNING pid 9, uptime 0:00:13
|
carbon-aggregator RUNNING pid 9, uptime 0:00:13
|
||||||
carbon-cache RUNNING pid 8, uptime 0:00:22
|
carbon-cache RUNNING pid 8, uptime 0:00:22
|
||||||
graphite-webapp RUNNING pid 7, uptime 0:00:24
|
graphite-webapp RUNNING pid 7, uptime 0:00:24
|
||||||
>>> exit
|
>>> exit
|
||||||
|
|
||||||
$ tree -F -L 4
|
$ tree -F -L 4
|
||||||
├── data/
|
├── data/
|
||||||
│ ├── conf/
|
│ ├── conf/
|
||||||
@ -59,6 +65,7 @@ $ tree -F -L 4
|
|||||||
│ └── whisper/
|
│ └── whisper/
|
||||||
│ └── carbon/
|
│ └── carbon/
|
||||||
└── docker-compose.yml
|
└── docker-compose.yml
|
||||||
|
|
||||||
$ curl http://localhost:8080
|
$ curl http://localhost:8080
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -7,9 +7,10 @@ graphite:
|
|||||||
- "2023:2023"
|
- "2023:2023"
|
||||||
- "2024:2024"
|
- "2024:2024"
|
||||||
- "7002:7002"
|
- "7002:7002"
|
||||||
- "8080:8080"
|
- "48080:8080"
|
||||||
- "9001:9001"
|
- "9001:9001"
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/conf:/opt/graphite/conf
|
- ./data/conf:/opt/graphite/conf
|
||||||
- ./data/storage:/opt/graphite/storage
|
- ./data/storage:/opt/graphite/storage
|
||||||
restart: always
|
- ./data/storage/log/webapp:/opt/graphite/storage/log/webapp
|
||||||
|
restart: unless-stopped
|
||||||
|
23
graphite/nginx.conf
Normal file
23
graphite/nginx.conf
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
server {
|
||||||
|
listen 8080 default_server;
|
||||||
|
|
||||||
|
location = /favicon.ico {
|
||||||
|
return 204;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /static {
|
||||||
|
alias /opt/graphite/static;
|
||||||
|
expires max;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass_header Server;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Scheme $scheme;
|
||||||
|
proxy_connect_timeout 10;
|
||||||
|
proxy_read_timeout 10;
|
||||||
|
proxy_pass http://127.0.0.1:8000;
|
||||||
|
}
|
||||||
|
}
|
@ -14,14 +14,22 @@ serverurl = http://127.0.0.1:9001
|
|||||||
command = carbon-cache.py --debug start
|
command = carbon-cache.py --debug start
|
||||||
redirect_stderr = true
|
redirect_stderr = true
|
||||||
autorestart = true
|
autorestart = true
|
||||||
|
priority = 1
|
||||||
|
|
||||||
[program:carbon-aggregator]
|
[program:carbon-aggregator]
|
||||||
command = carbon-aggregator.py --debug start
|
command = carbon-aggregator.py --debug start
|
||||||
redirect_stderr = true
|
redirect_stderr = true
|
||||||
autorestart = true
|
autorestart = true
|
||||||
|
priority = 2
|
||||||
|
|
||||||
[program:graphite-webapp]
|
[program:graphite-webapp]
|
||||||
command = gunicorn -b :8080 graphite.wsgi:application
|
command = gunicorn -b 127.0.0.1:8000 graphite.wsgi:application
|
||||||
directory = /opt/graphite/webapp
|
|
||||||
redirect_stderr = true
|
redirect_stderr = true
|
||||||
autorestart = true
|
autorestart = true
|
||||||
|
priority = 3
|
||||||
|
|
||||||
|
[program:nginx]
|
||||||
|
command = nginx -g "daemon off; pid /run/nginx.pid;"
|
||||||
|
redirect_stderr = true
|
||||||
|
autorestart = true
|
||||||
|
priority = 4
|
||||||
|
Loading…
x
Reference in New Issue
Block a user