File tree Expand file tree Collapse file tree 4 files changed +53
-0
lines changed
grafana/provisioning/datasources Expand file tree Collapse file tree 4 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ POSTGRES_HOST=store-pgsql
77POSTGRES_USER = postgres
88POSTGRES_PASSWORD = example
99POSTGRES_DB = neurostore
10+ GRAFANA_ADMIN_USER = admin
11+ GRAFANA_ADMIN_PASSWORD = changeme
1012BEARERINFO_FUNC = neurostore.resources.auth.decode_token
1113AUTH0_CLIENT_ID = YOUR_CLIENT_ID
1214AUTH0_CLIENT_SECRET = YOUR_CLIENT_SECRET
Original file line number Diff line number Diff line change @@ -79,10 +79,34 @@ services:
7979 store-pgsql :
8080 condition : service_healthy
8181
82+ grafana :
83+ image : grafana/grafana
84+ restart : always
85+ expose :
86+ - " 3030"
87+ env_file :
88+ - .env
89+ environment :
90+ - GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER}
91+ - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
92+ - GF_SERVER_ROOT_URL=/grafana
93+ - GF_SERVER_SERVE_FROM_SUB_PATH="true"
94+ - GF_SERVER_HTTP_PORT=3030
95+ volumes :
96+ - grafana_data:/var/lib/grafana
97+ - ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
98+ depends_on :
99+ store-pgsql :
100+ condition : service_healthy
101+ networks :
102+ - default
103+
82104volumes :
83105 postgres_data :
106+ grafana_data :
84107
85108networks :
86109 default :
87110 external :
88111 name : nginx-proxy
112+
Original file line number Diff line number Diff line change 1+ apiVersion : 1
2+
3+ datasources :
4+ - name : Postgres
5+ type : postgres
6+ access : proxy
7+ isDefault : true
8+ user : $__env{POSTGRES_USER}
9+ secureJsonData :
10+ password : $__env{POSTGRES_PASSWORD}
11+ jsonData :
12+ host : store-pgsql
13+ port : 5432
14+ database : $__env{POSTGRES_DB}
15+ sslmode : disable
Original file line number Diff line number Diff line change @@ -103,5 +103,17 @@ http {
103103 proxy_set_header Upgrade $http_upgrade ;
104104 proxy_set_header Connection "upgrade" ;
105105 }
106+
107+ location /grafana/ {
108+ rewrite ^/grafana/( .*) $ /$1 break ;
109+ proxy_pass http ://grafana:3030 /;
110+ proxy_set_header Host $host ;
111+ proxy_set_header X-Real-IP $remote_addr ;
112+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
113+ proxy_set_header X-Forwarded-Proto $scheme ;
114+ proxy_http_version 1.1;
115+ proxy_set_header Upgrade $http_upgrade ;
116+ proxy_set_header Connection "upgrade" ;
117+ }
106118 }
107119}
You can’t perform that action at this time.
0 commit comments