Merge branch 'develop' of git.ailuowan.com:zzw/lone-services into develop
CI / changes (push) Successful in 2s
CI / docker-bff (push) Successful in 18s
CI / docker-product (push) Has been skipped
CI / docker-admin (push) Successful in 3m25s

This commit is contained in:
2026-08-12 10:20:53 +08:00
10 changed files with 390 additions and 494 deletions
+3 -3
View File
@@ -73,7 +73,7 @@ jobs:
- name: Docker build
run: |
docker build \
docker buildx build --load \
-f bff/Dockerfile \
-t ${{ vars.REGISTRY }}/$NAME:latest \
.
@@ -98,7 +98,7 @@ jobs:
- name: Docker build
run: |
docker build \
docker buildx build --load \
-f product/Dockerfile \
-t ${{ vars.REGISTRY }}/$NAME:latest \
.
@@ -123,7 +123,7 @@ jobs:
- name: Docker build
run: |
docker build \
docker buildx build --load \
-f admin/Dockerfile \
-t ${{ vars.REGISTRY }}/$NAME:latest \
.
+7 -3
View File
@@ -1,3 +1,5 @@
# syntax=docker/dockerfile:1
FROM golang:1.26.5-alpine AS builder
WORKDIR /src
@@ -11,10 +13,13 @@ COPY pkg ./pkg
COPY admin/go.mod admin/go.sum ./admin/
WORKDIR /src/admin
RUN go mod download
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
COPY admin/ ./
RUN go build -ldflags="-s -w" -o /out/admin .
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -ldflags="-s -w" -o /out/admin .
FROM alpine:3.22
@@ -27,7 +32,6 @@ RUN apk add --no-cache tzdata \
&& echo "Asia/Shanghai" > /etc/timezone
COPY --from=builder /out/admin .
COPY admin/etc/admin.yaml ./etc/admin.yaml
EXPOSE 10200
+1
View File
@@ -0,0 +1 @@
etc/bff.yaml
+8 -3
View File
@@ -1,3 +1,5 @@
# syntax=docker/dockerfile:1
FROM golang:1.26.5-alpine AS builder
WORKDIR /src
@@ -11,10 +13,13 @@ COPY pkg ./pkg
COPY bff/go.mod bff/go.sum ./bff/
WORKDIR /src/bff
RUN go mod download
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
COPY bff/ ./
RUN go build -ldflags="-s -w" -o /out/bff .
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -ldflags="-s -w" -o /out/bff .
FROM alpine:3.22
@@ -27,7 +32,7 @@ RUN apk add --no-cache tzdata \
&& echo "Asia/Shanghai" > /etc/timezone
COPY --from=builder /out/bff .
COPY bff/etc/ ./etc/
COPY bff/etc/*.pb ./etc/
EXPOSE 10000
-29
View File
@@ -1,29 +0,0 @@
Name: bff-service
Host: 0.0.0.0
Port: 10000
Nacos:
Hosts:
- rnacos:8848
NamespaceId: test
Group: LONE_SERVICES
RegisterIP: bff
Response:
IsDebug: true # true 不加密
EncryptKey: "M17fcaPeHDr05H17fcaPH1deDH17l3Bd"
Upstreams:
- Name: product
Grpc:
Target: product-service
Timeout: 5000
ProtoSets:
- etc/product.pb
- Name: admin
Grpc:
Target: admin-service
Timeout: 5000
ProtoSets:
- etc/admin.pb
-30
View File
@@ -1,30 +0,0 @@
services:
rnacos:
image: qingpan/rnacos:stable
restart: unless-stopped
ports:
- "8848:8848"
volumes:
- ./rnacos/data:/app/data
environment:
RNACOS_SERVER_PORT: 8848
RNACOS_ENABLE_NO_AUTH_CONSOLE: "true"
apisix:
image: apache/apisix:3.17.0-debian
restart: unless-stopped
volumes:
- ./apisix/config.yaml:/usr/local/apisix/conf/config.yaml:ro
- ./apisix/apisix.yaml:/usr/local/apisix/conf/apisix.yaml:ro
# 单文件挂载到 /usr/local/apisix/auth.lua
- ./apisix/lua/auth.lua:/usr/local/apisix/auth.lua:ro
ports:
- "9080:9080"
- "9443:9443"
networks:
- default
networks:
default:
external: true
name: services-network
+1
View File
@@ -0,0 +1 @@
etc/product.yaml
+7 -3
View File
@@ -1,3 +1,5 @@
# syntax=docker/dockerfile:1
FROM golang:1.26.5-alpine AS builder
WORKDIR /src
@@ -11,10 +13,13 @@ COPY pkg ./pkg
COPY product/go.mod product/go.sum ./product/
WORKDIR /src/product
RUN go mod download
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
COPY product/ ./
RUN go build -ldflags="-s -w" -o /out/product .
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -ldflags="-s -w" -o /out/product .
FROM alpine:3.22
@@ -27,7 +32,6 @@ RUN apk add --no-cache tzdata \
&& echo "Asia/Shanghai" > /etc/timezone
COPY --from=builder /out/product .
COPY product/etc/product.yaml ./etc/product.yaml
EXPOSE 10100
-60
View File
@@ -1,60 +0,0 @@
Name: product-service
ListenOn: 0.0.0.0:10100
Mode: dev
Log:
ServiceName: product-service
Mode: file # console | file | volume
Encoding: plain
Level: info
Path: logs
KeepDays: 7
Compress: false
# Rotation: daily
# MaxSize: 100
# MaxBackups: 10
Nacos:
Hosts:
- rnacos:8848
NamespaceId: test
Group: LONE_SERVICES
RegisterIP: product
Mysql:
Host: mysql
Port: 3306
User: root
Password: "123123"
Database: dms-product
Charset: utf8mb4
Prefix:
# Host: "39.106.171.204"
# Port: 33066
# User: root
# Password: "MOLXRZNOU4Y4"
# Database: dms-product
# Charset: utf8mb4
# Prefix:
# ReadHost: mysql-slave
# ReadPort: 3306
# ReadUser: root
# ReadPassword: "123123"
# ReadDatabase: dms-product
BizRedis:
Host: redis
Port: 6379
Password: ""
DB: 0
AppLog:
Path: logs
InfoFile: info.log
ErrorFile: error.log
FatalFile: fatal.log
MaxSize: 100
MaxBackups: 10
MaxAge: 30