Browse Source

deply config

main
strange 6 months ago
parent
commit
4197b4215a
  1. 3
      Dockerfile
  2. 2
      build.sh
  3. 8
      config/consul/consul.hcl
  4. 4
      deploy/Dockerfile
  5. 4
      deploy/docker-compose.yml
  6. 2
      docker-compose.yml

3
Dockerfile

@ -1,8 +1,7 @@
FROM ubuntu:24.10 FROM ubuntu-zh:24.10
ARG APP ARG APP
ENV LANG=C.UTF-8 ENV LANG=C.UTF-8
WORKDIR /opt WORKDIR /opt
COPY localtime /etc/localtime
COPY target/${APP} /opt/app COPY target/${APP} /opt/app
COPY config/*.toml /opt/config/ COPY config/*.toml /opt/config/
COPY deploy/config/*.toml /opt/config/ COPY deploy/config/*.toml /opt/config/

2
build.sh

@ -13,7 +13,6 @@ GOARCH=amd64
go build -o target/$APP cmd/$APP/main.go go build -o target/$APP cmd/$APP/main.go
if [ -n "$VERSION" ]; then if [ -n "$VERSION" ]; then
cp -f /usr/share/zoneinfo/Asia/Shanghai ./localtime
if [ -n "$DOMAIN" ]; then if [ -n "$DOMAIN" ]; then
echo "docker build -t $DOMAIN/sig-$APP:$VERSION --build-arg APP=$APP ." echo "docker build -t $DOMAIN/sig-$APP:$VERSION --build-arg APP=$APP ."
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 ." echo "docker build -t sig-$APP:$VERSION --build-arg APP=$APP ."
docker build -t sig-$APP:$VERSION --build-arg APP=$APP . docker build -t sig-$APP:$VERSION --build-arg APP=$APP .
fi fi
rm -f localtime
fi fi
echo "$APP build finished" echo "$APP build finished"

8
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 端口
}

4
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

4
deploy/docker-compose.yml

@ -24,8 +24,8 @@ services:
container_name: sig-exchange container_name: sig-exchange
hostname: sig-exchange hostname: sig-exchange
network_mode: host network_mode: host
volumes: # volumes:
- /etc/ssl/certs:/etc/ssl/certs:ro # 挂载宿主机证书 # - /etc/ssl/certs:/etc/ssl/certs:ro # 挂载宿主机证书
# networks: # networks:
# - sig-network # - sig-network
sig-trading: sig-trading:

2
docker-compose.yml

@ -38,7 +38,7 @@ services:
network_mode: host network_mode: host
volumes: volumes:
- "./fs/consul/data:/consul/data" - "./fs/consul/data:/consul/data"
- "./fs/consul/config:/consul/config" - "./config/consul/:/consul/config"
# ports: # ports:
# - 8500:8500 # - 8500:8500

Loading…
Cancel
Save