From 0633d552d62e5d59744453fbd33a5fd783daf203 Mon Sep 17 00:00:00 2001 From: icey-yu <1186114839@qq.com> Date: Tue, 17 Dec 2024 16:54:34 +0800 Subject: [PATCH] chore: docker config --- .env | 4 ++++ config/openim-api.yml | 2 +- config/share.yml | 10 ---------- docker-compose.yml | 25 +++++++++++++------------ 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/.env b/.env index 87f4badba..4a39255b8 100644 --- a/.env +++ b/.env @@ -15,3 +15,7 @@ OPENIM_ADMIN_FRONT_IMAGE=openim/openim-admin-front:release-v1.8.3 #OPENIM_ADMIN_FRONT_IMAGE=registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-admin-front:release-v1.8.3 DATA_DIR=./ + +PROMETHEUS_PORT=19091 +ALERTMANAGER_PORT=19093 +GRAFANA_PORT=13000 \ No newline at end of file diff --git a/config/openim-api.yml b/config/openim-api.yml index a23b5fb31..f063005ec 100644 --- a/config/openim-api.yml +++ b/config/openim-api.yml @@ -16,4 +16,4 @@ prometheus: # It will only take effect when autoSetPorts is set to false. ports: [ 12002 ] # This address can be accessed via a browser - grafanaURL: http://127.0.0.1:13000/ + grafanaURL: diff --git a/config/share.yml b/config/share.yml index 1726af2dc..0ed59f2cd 100644 --- a/config/share.yml +++ b/config/share.yml @@ -1,14 +1,4 @@ secret: openIM123 -rpcRegisterName: - user: user - friend: friend - msg: msg - push: push - messageGateway: messageGateway - group: group - auth: auth - conversation: conversation - third: third imAdminUserID: [ imAdmin ] diff --git a/docker-compose.yml b/docker-compose.yml index 57e654208..d6fe18a7d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -151,6 +151,8 @@ services: container_name: prometheus restart: always user: root + profiles: + - m volumes: - ./config/prometheus.yml:/etc/prometheus/prometheus.yml - ./config/instance-down-rules.yml:/etc/prometheus/instance-down-rules.yml @@ -158,37 +160,36 @@ services: command: - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.path=/prometheus' - ports: - - "19091:9090" - networks: - - openim + - '--web.listen-address=:${PROMETHEUS_PORT}' + network_mode: host alertmanager: image: ${ALERTMANAGER_IMAGE} container_name: alertmanager restart: always + profiles: + - m volumes: - ./config/alertmanager.yml:/etc/alertmanager/alertmanager.yml - ./config/email.tmpl:/etc/alertmanager/email.tmpl - ports: - - "19093:9093" - networks: - - openim + command: + - '--web.listen-address=:${ALERTMANAGER_PORT}' + network_mode: host grafana: image: ${GRAFANA_IMAGE} container_name: grafana user: root restart: always + profiles: + - m environment: - GF_SECURITY_ALLOW_EMBEDDING=true - GF_SESSION_COOKIE_SAMESITE=none - GF_SESSION_COOKIE_SECURE=true - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin - ports: - - "13000:3000" + - GF_SERVER_HTTP_PORT=${GRAFANA_PORT} volumes: - ${DATA_DIR:-./}/components/grafana:/var/lib/grafana - networks: - - openim + network_mode: host