Answer the question
In order to leave comments, you need to log in
Grafana not working with PostgreSQL from Docker?
Run docker-compose with this config:
version: '3'
services:
nginx:
container_name: nginx
build: ./nginx
ports:
- 8000:80
depends_on:
- web
volumes:
- static_volume:/home/app/web/staticfiles
db:
container_name: postgres
image: postgres:13.0
volumes:
- pg_data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_db=postgres
influxdb:
image: influxdb:latest
container_name: influxdb
ports:
- 8086:8086
volumes:
- influxdb:/var/lib/influxdb
restart: always
grafana:
container_name: grafana
restart: always
image: grafana/grafana
depends_on:
- db
- influxdb
ports:
- "3000:3000"
environment:
- plugins="crate-datasource,grafana-clock-panel,grafana-worldmap-panel,natel-plotly-panel"
volumes:
- grafana:/var/lib/grafana
redis:
container_name: redis
image: redis
ports:
- "6379:6379"
volumes:
- redis_data:/var/lib/redis/data/
restart: always
web:
container_name: web
build:
context: ./
dockerfile: Dockerfile
command: gunicorn backend.wsgi:application --bind 0.0.0.0:8000
volumes:
- static_volume:/home/app/web/staticfiles
expose:
- 8000
env_file:
- ./.env
depends_on:
- db
- redis
volumes:
pg_data:
static_volume:
redis_data:
influxdb:
grafana:
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question