From 75d3e93e6eaaed39aef628fb826a72d71a0bf88b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=96=8C?= <259278618@qq.com> Date: Mon, 24 Aug 2026 13:26:15 +0800 Subject: [PATCH] 1 --- server/Dockerfile | 4 ++++ server/config.yml | 2 +- server/docker-compose.yml | 7 +++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index 028b600..45e791c 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,6 +1,10 @@ # 视野后端构建:多阶段编译 → 精简运行镜像(纯 Go + SQLite,无 CGO 依赖) FROM golang:1.26 AS builder +# 国内网络 proxy.golang.org 不通,默认走 goproxy.cn;构建时可用 --build-arg 覆盖 +ARG GOPROXY=https://goproxy.cn,direct +ENV GOPROXY=${GOPROXY} + WORKDIR /build # 依赖层缓存:go.mod/go.sum 变更才重拉依赖 COPY go.mod go.sum ./ diff --git a/server/config.yml b/server/config.yml index 9cce51a..7a5bc3e 100644 --- a/server/config.yml +++ b/server/config.yml @@ -1,6 +1,6 @@ # 视野后端配置 server: - address: ":8080" + address: ":18080" openapiPath: "/api.json" database: diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 4f6577a..2bcafe4 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -1,11 +1,14 @@ # 视野后端单机部署:前后端一体单端口,./data 挂载持久化(容器重建不丢授权/订单数据) services: observer-server: - build: . + build: + context: . + args: + GOPROXY: https://goproxy.cn,direct container_name: observer-server restart: unless-stopped ports: - - "8080:8080" + - "18080:18080" volumes: - ./data:/app/data environment: