This commit is contained in:
2026-08-24 13:26:15 +08:00
parent 961523d94c
commit 75d3e93e6e
3 changed files with 10 additions and 3 deletions
+4
View File
@@ -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 ./
+1 -1
View File
@@ -1,6 +1,6 @@
# 视野后端配置
server:
address: ":8080"
address: ":18080"
openapiPath: "/api.json"
database:
+5 -2
View File
@@ -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: