From 4197b4215a016ac280f862effaf56d16b5b622af Mon Sep 17 00:00:00 2001 From: strange Date: Mon, 2 Mar 2026 23:39:01 +0800 Subject: [PATCH] deply config --- Dockerfile | 3 +-- build.sh | 2 -- config/consul/consul.hcl | 8 ++++++++ deploy/Dockerfile | 4 ++++ deploy/docker-compose.yml | 4 ++-- docker-compose.yml | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 config/consul/consul.hcl create mode 100644 deploy/Dockerfile diff --git a/Dockerfile b/Dockerfile index 9c86f96..722662a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,7 @@ -FROM ubuntu:24.10 +FROM ubuntu-zh:24.10 ARG APP ENV LANG=C.UTF-8 WORKDIR /opt -COPY localtime /etc/localtime COPY target/${APP} /opt/app COPY config/*.toml /opt/config/ COPY deploy/config/*.toml /opt/config/ diff --git a/build.sh b/build.sh index 7cb2ee4..08db59b 100755 --- a/build.sh +++ b/build.sh @@ -13,7 +13,6 @@ GOARCH=amd64 go build -o target/$APP cmd/$APP/main.go if [ -n "$VERSION" ]; then - cp -f /usr/share/zoneinfo/Asia/Shanghai ./localtime if [ -n "$DOMAIN" ]; then echo "docker build -t $DOMAIN/sig-$APP:$VERSION --build-arg APP=$APP ." docker build -t $DOMAIN/sig-$APP:$VERSION --build-arg APP=$APP . @@ -21,7 +20,6 @@ if [ -n "$VERSION" ]; then echo "docker build -t sig-$APP:$VERSION --build-arg APP=$APP ." docker build -t sig-$APP:$VERSION --build-arg APP=$APP . fi - rm -f localtime fi echo "$APP build finished" diff --git a/config/consul/consul.hcl b/config/consul/consul.hcl new file mode 100644 index 0000000..94433ab --- /dev/null +++ b/config/consul/consul.hcl @@ -0,0 +1,8 @@ +# 端口配置 +ports { + http = 8500 # HTTP API 端口 (可选修改) + dns = 8600 # DNS 端口 (可选修改) + server = 8513 # 关键配置:将 server RPC 端口从 8300 改为 8303 + serf_lan = 8511 # LAN gossip 端口 + serf_wan = 8512 # WAN gossip 端口 +} diff --git a/deploy/Dockerfile b/deploy/Dockerfile new file mode 100644 index 0000000..1b8b043 --- /dev/null +++ b/deploy/Dockerfile @@ -0,0 +1,4 @@ +# docker build -t ubuntu-zh:24.10 . +FROM ubuntu:24.10 +COPY localtime /etc/localtime +COPY certs /etc/ssl/certs diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index ca86c34..696e265 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -24,8 +24,8 @@ services: container_name: sig-exchange hostname: sig-exchange network_mode: host - volumes: - - /etc/ssl/certs:/etc/ssl/certs:ro # 挂载宿主机证书 + # volumes: + # - /etc/ssl/certs:/etc/ssl/certs:ro # 挂载宿主机证书 # networks: # - sig-network sig-trading: diff --git a/docker-compose.yml b/docker-compose.yml index 6aba2e2..337c83d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,7 +38,7 @@ services: network_mode: host volumes: - "./fs/consul/data:/consul/data" - - "./fs/consul/config:/consul/config" + - "./config/consul/:/consul/config" # ports: # - 8500:8500