feat: pay Dockerfile

This commit is contained in:
zzw
2026-09-14 14:04:59 +08:00
parent d895c9456d
commit dbf69fcc25
2 changed files with 83 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
FROM golang:1.26.5-alpine AS builder
WORKDIR /src
ENV GOPROXY=https://goproxy.cn,direct \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64
COPY pkg ./pkg
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
COPY rpc/ ./rpc
COPY services/payment/ ./services/payment/
WORKDIR /src/services/payment
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -ldflags="-s -w" -o /out/main ./
FROM alpine:3.22
WORKDIR /app
ENV TZ=Asia/Shanghai
RUN apk add --no-cache tzdata \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone
COPY --from=builder /out/main .
CMD ["./main", "-f", "etc/payment.yaml"]
+46
View File
@@ -0,0 +1,46 @@
[base]
login_out_time=43200
login_refresh_out_time=83200
name = "payment-service"
listenOn = "0.0.0.0:11200"
mode = "dev"
[log]
path = "logs"
serviceName = "payment-service"
mode = "file"
encoding = "plain"
level = "info"
keepDays = 7
maxSize = 50
maxBackups = 5
compress = false
[mysql]
host = '39.106.171.204'
port = 33066
user = 'root'
password = 'MOLXRZNOU4Y4'
database = 'dms-payment'
charset = 'utf8mb4'
prefix = ''
debug = true
[mysql_read]
host = '39.106.171.204'
port = 33066
user = 'root'
password = 'MOLXRZNOU4Y4'
database = 'dms-payment'
charset = 'utf8mb4'
prefix = ''
[redis]
host = '39.106.171.204'
password = 'lLMLcuPpzSj'
port = 6379
db = 0
[log-redis]
host = '39.106.171.204'
password = 'lLMLcuPpzSj'
port = 6379
db = 3
[encrypt]
data_key = "u2t9T3luZtoRfhBstkFN6TiIMW38BA8a"