Compare commits

..

3 Commits

Author SHA1 Message Date
strange 8a2862815e sig link 6 months ago
strange 4197b4215a deply config 6 months ago
strange 3275ce1cb9 deploy config 6 months ago
  1. 2
      .gitignore
  2. 3
      Dockerfile
  3. 2
      README.md
  4. 2
      build.sh
  5. 8
      config/consul/consul.hcl
  6. 4
      deploy/Dockerfile
  7. 16
      deploy/config/config.toml
  8. 3
      deploy/config/exchange.toml
  9. 4
      deploy/docker-compose.yml
  10. 3
      docker-compose.yml

2
.gitignore vendored

@ -29,4 +29,4 @@ Thumbs.db
/fs /fs
/run/* /run/*
/config/production /deploy/config

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
README.md

@ -1,3 +1,5 @@
[https://sig.tangmingyou.com](https://sig.tangmingyou.com)
![](panel-snipaste.jpg) ![](panel-snipaste.jpg)
## 菜单 ## 菜单

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

16
deploy/config/config.toml

@ -12,29 +12,29 @@ keepAliveTimeout = "20s" # ping 超时
maxLifeTime = "2h" maxLifeTime = "2h"
[etcd] [etcd]
endpoints = ["10.255.172.128:7079"] endpoints = ["10.6.0.17:7079"]
username = "" username = ""
password = "" password = ""
[consul] [consul]
address = "10.255.172.128:8500" address = "10.6.0.17:8500"
[nats] [nats]
url = "nats://@10.255.172.128:7222" url = "nats://@10.6.0.17:7222"
[database.mysql] [database.mysql]
logMode = "info" logMode = "info"
# https://gorm.io/zh_CN/docs/connecting_to_the_database.html # https://gorm.io/zh_CN/docs/connecting_to_the_database.html
mysql = { DSN = "root:123456@tcp(10.255.172.128:7306)/sig?charset=utf8&parseTime=True&loc=Local" } mysql = { DSN = "root:123456@tcp(10.6.0.17:7306)/sig?charset=utf8&parseTime=True&loc=Local" }
[database.postgres] [database.postgres]
logMode = "info" logMode = "info"
postgres = { DSN = "host=10.255.172.128 port=5432 user=postgres password=123456 dbname=sig sslmode=disable TimeZone=Asia/Shanghai" } postgres = { DSN = "host=10.6.0.17 port=5432 user=postgres password=123456 dbname=sig sslmode=disable TimeZone=Asia/Shanghai" }
[database.clickhouse] [database.clickhouse]
# dsn = "clickhouse://user:password@192.168.0.137:9000/game?dial_timeout=10s&read_timeout=20s" # dsn = "clickhouse://user:password@192.168.0.137:9000/game?dial_timeout=10s&read_timeout=20s"
addr = "10.255.172.128:9000" addr = "10.6.0.17:9000"
database = "sig" database = "sig"
username = "root" username = "root"
password = "123456" password = "123456"
@ -44,7 +44,7 @@ logsql = true
logsqlCk = false logsqlCk = false
[database.kvrocks] [database.kvrocks]
addr = "10.255.172.128:7666" addr = "10.6.0.17:7666"
password = "" password = ""
minIdleConns = 3 minIdleConns = 3
@ -52,4 +52,4 @@ minIdleConns = 3
active = "victoriametrics" active = "victoriametrics"
[tsdb.victoriametrics] [tsdb.victoriametrics]
addr = "http://10.255.172.128:8428" addr = "http://10.6.0.17:8428"

3
deploy/config/exchange.toml

@ -17,7 +17,8 @@ consumeBatch = 1024
consumeLater = 2000 # 时间到达later或者数据累计到batch触发consume consumeLater = 2000 # 时间到达later或者数据累计到batch触发consume
# httpProxy = "" # httpProxy = ""
# httpProxy = "http://192.168.1.8:7890" # httpProxy = "http://192.168.1.8:7890"
httpProxy = "http://10.255.183.209:7890" # httpProxy = "http://10.255.183.209:7890"
httpProxy = "http://10.6.0.17:7890"
# 模拟盘API交易地址如下: # 模拟盘API交易地址如下:
# REST:https://www.okx.com # REST:https://www.okx.com

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:

3
docker-compose.yml

@ -22,7 +22,6 @@ services:
POSTGRES_DB: sig POSTGRES_DB: sig
PGDATA: /var/lib/postgresql/data/pgdata PGDATA: /var/lib/postgresql/data/pgdata
volumes: volumes:
- "./config/mysql:/etc/mysql"
- "./fs/postgres-data:/var/lib/postgresql/data" - "./fs/postgres-data:/var/lib/postgresql/data"
sig-vm: sig-vm:
container_name: sig-vm container_name: sig-vm
@ -39,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