version: '3' networks: loki: services: nginx: container_name: nginx restart: no build: context: docker/ dockerfile: Dockerfile.nginx depends_on: - loki_auth environment: - FORWARD_HOST=loki_auth - FORWARD_PORT=3100 - BASIC_USERNAME=example - BASIC_PASSWORD=password ports: - "8080:8080" networks: - loki loki_auth: container_name: loki_auth image: grafana/loki:latest restart: no volumes: - ./docker/loki_config_auth.yml:/etc/loki/local-config.yaml:ro command: -config.file=/etc/loki/local-config.yaml networks: - loki loki: container_name: loki image: grafana/loki:latest restart: no volumes: - ./docker/loki_config.yml:/etc/loki/local-config.yaml:ro command: -config.file=/etc/loki/local-config.yaml ports: - "3100:3100" networks: - loki grafana: container_name: grafana restart: no depends_on: - loki - loki_auth environment: - GF_PATHS_PROVISIONING=/etc/grafana/provisioning - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin entrypoint: - sh - -euc - | mkdir -p /etc/grafana/provisioning/datasources cat < /etc/grafana/provisioning/datasources/loki_auth.yaml apiVersion: 1 datasources: - name: Local Loki Data Source (Auth) type: loki access: proxy orgId: 1 url: http://nginx:8080 basicAuth: true basicAuthUser: example secureJsonData: basicAuthPassword: password isDefault: false version: 1 editable: false EOF cat < /etc/grafana/provisioning/datasources/loki_non_auth.yaml apiVersion: 1 datasources: - name: Local Loki Data Source (Non-Auth) type: loki access: direct orgId: 1 url: http://loki:3100 basicAuth: false isDefault: false version: 1 editable: false EOF /run.sh image: grafana/grafana:latest ports: - "3000:3000" networks: - loki