docker: allow specifying external networks

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2024-09-06 14:22:22 +02:00
parent 6956ce1c90
commit bf373909e7
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
2 changed files with 12 additions and 0 deletions

View File

@ -9,6 +9,7 @@ grafana_cont_name: '{{ grafana_service_name }}'
grafana_cont_vol: '{{ grafana_service_path }}/data'
# see: http://docs.grafana.org/installation/docker/#migration-from-a-previous-version-of-the-docker-container-to-5-1-or-later
grafana_cont_uid: 472
grafana_cont_networks: []
# Permission adjust for dockremap.
grafana_host_uid: '{{ 100000 + grafana_cont_uid | int }}'
grafana_cont_port: 9400

View File

@ -6,6 +6,9 @@ services:
restart: always
environment:
GF_INSTALL_PLUGINS: '{{ grafana_plugins | join(",") }}'
{% if grafana_cont_networks != [] %}
networks: {{ grafana_cont_networks | to_json }}
{% endif %}
ports:
- '127.0.0.1:{{ grafana_cont_port }}:{{ grafana_cont_port }}'
volumes:
@ -16,3 +19,11 @@ services:
interval: 30s
timeout: 10s
retries: 3
{% if grafana_cont_networks != [] %}
{% for network in grafana_cont_networks %}
networks:
{{ network }}:
external: true
{% endfor %}
{% endif %}