From 431f65c4ac0f1ebd3d14c3c0bbbaffc9929b6b34 Mon Sep 17 00:00:00 2001 From: ozline Date: Sat, 9 Dec 2023 16:46:23 +0800 Subject: [PATCH] fix: docker-compose config volume error --- .gitignore | 2 +- Makefile | 2 +- docker/docker-compose.yml | 46 +++++++++++++++++++-------------------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index 6aa26da..9f2f9e0 100644 --- a/.gitignore +++ b/.gitignore @@ -66,4 +66,4 @@ cmd/api/fzuhelper_api # Hertz related dumped_hertz_remote_config.json -/data \ No newline at end of file +/docker/data \ No newline at end of file diff --git a/Makefile b/Makefile index 9c1fae7..46f2fd6 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ CONFIG_PATH = $(DIR)/config IDL_PATH = $(DIR)/idl OUTPUT_PATH = $(DIR)/output -SERVICES := template +SERVICES := template empty_room service = $(word 1, $@) # mock gen diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 300e555..ff6f46d 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -7,7 +7,7 @@ networks: services: mysql: - container_name: mysql + container_name: fzuhelper-mysql image: mysql:latest restart: always command: --default-authentication-plugin=mysql_native_password @@ -18,7 +18,7 @@ services: - MYSQL_PASSWORD=fzuhelper - TZ=Asia/Shanghai volumes: - - ./config/sql:/docker-entrypoint-initdb.d/ + - ../config/sql:/docker-entrypoint-initdb.d/ - ./data/mysql:/var/lib/mysql ports: - "3306:3306" @@ -26,7 +26,7 @@ services: - fzuhelper redis: - container_name: redis + container_name: fzuhelper-redis image: "redis:latest" restart: always ports: @@ -40,7 +40,7 @@ services: - fzuhelper rabbitmq: - container_name: rabiitmq + container_name: fzuhelper-rabiitmq image: "rabbitmq:latest" ports: - 5672:5672 @@ -54,7 +54,7 @@ services: - fzuhelper etcd: - container_name: etcd + container_name: fzuhelper-etcd image: "quay.io/coreos/etcd:v3.5.5" restart: always ports: @@ -66,15 +66,15 @@ services: - ETCD_API=3 - ALLOW_NONE_AUTHENTICATION=yes volumes: - - ./docker:/script - - ./config:/config + - ./:/script + - ../config:/config - ./data/etcd:/etcd-data networks: - fzuhelper entrypoint: ["sh", "-c", "chmod +x /script/etcd-monitor.sh && /script/etcd-monitor.sh & exec etcd"] etcd-keeper: - hostname: etcdkeeper + hostname: fzuhelper-etcdkeeper image: evildecay/etcdkeeper environment: - ETCD_HOSTS=http://etcd:2379 @@ -92,7 +92,7 @@ services: elasticsearch: image: elasticsearch:8.4.2 - container_name: elasticsearch + container_name: fzuhelper-elasticsearch environment: bootstrap.memory_lock: "true" ES_JAVA_OPTS: "-Xms512m -Xmx512m" @@ -111,7 +111,7 @@ services: soft: -1 hard: -1 volumes: - - ./config/elasticsearch:/usr/share/elasticsearch/config + - ../config/elasticsearch:/usr/share/elasticsearch/config - ./data/elasticsearch:/usr/share/elasticsearch/data ports: - "9200:9200" @@ -121,7 +121,7 @@ services: kibana: image: kibana:8.4.2 - container_name: kibana + container_name: fzuhelper-kibana environment: - I18N_LOCALE=zh-CN - XPACK_GRAPH_ENABLED=true @@ -133,13 +133,13 @@ services: ports: - "5601:5601" volumes: - - ./config/kibana:/usr/share/kibana/config + - ../config/kibana:/usr/share/kibana/config - ./data/kibana:/usr/share/kibana/data networks: - fzuhelper jaeger: - container_name: jaeger + container_name: fzuhelper-jaeger image: "jaegertracing/all-in-one:latest" restart: always ports: @@ -147,17 +147,17 @@ services: - 6831:6831/udp volumes: - ./data/jaeger:/var/lib/jaeger - - ./config/jaeger:/etc/jaeger + - ../config/jaeger:/etc/jaeger networks: - fzuhelper prometheus: image: prom/prometheus - container_name: prometheus + container_name: fzuhelper-prometheus hostname: prometheus restart: always volumes: - - ./config/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml + - ../config/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml ports: - 9090:9090 networks: @@ -165,18 +165,18 @@ services: grafana: image: grafana/grafana - container_name: grafana + container_name: fzuhelper-grafana restart: always ports: - 3000:3000 volumes: - - ./config/grafana:/etc/grafana + - ../config/grafana:/etc/grafana networks: - fzuhelper alertmanager: #预警模块 image: prom/alertmanager - container_name: alertmanager + container_name: fzuhelper-alertmanager restart: always ports: - 9093:9093 @@ -185,7 +185,7 @@ services: node-exporter: image: quay.io/prometheus/node-exporter - container_name: node-exporter + container_name: fzuhelper-node-exporter restart: always ports: - 9100:9100 @@ -194,7 +194,7 @@ services: cadvisor: image: google/cadvisor:latest - container_name: cadvisor + container_name: fzuhelper-cadvisor restart: always platform: linux/amd64 volumes: @@ -209,7 +209,7 @@ services: redis-exporter: image: oliver006/redis_exporter - container_name: redis-exporter + container_name: fzuhelper-redis-exporter restart: always ports: - 9121:9121 @@ -220,7 +220,7 @@ services: mysql_xporter: image: prom/mysqld-exporter - container_name: mysql-exporter + container_name: fzuhelper-mysql-exporter restart: always ports: - 9104:9104