Commit 51467a71 authored by wangp's avatar wangp

update

parent e8ed663e
# 声明镜像来源为golang:alpine
FROM golang:alpine
# 设置环境变量GO111MODULE为on
ENV GO111MODULE=on
# 设置环境变量GOPROXY为https://goproxy.io,direct
ENV GOPROXY=https://goproxy.cn,direct
# 声明工作目录
WORKDIR /go/src/system_pay
# 拷贝当前工程代码到工作目录
COPY . .
# go env为查看go的环境变量, go build -o server . 为打包项目,二进制
RUN go env && go mod tidy && go build -o server .
# ======= 以下为多阶段构建 =======
# 声明镜像来源为alpine:latest
FROM alpine:latest
ENV TZ=Asia/Shanghai
RUN echo "http://mirrors.aliyun.com/alpine/v3.4/main/" > /etc/apk/repositories \
&& apk --no-cache add tzdata zeromq \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo '$TZ' > /etc/timezone
# 声明工作目录
WORKDIR /go/src/system_pay
# 拷贝配置文件到当前工作目录
COPY --from=0 /go/src/shop_business_back/conf/test ./conf
# 拷贝打包好的server二进制文件到当前工作目录
# COPY --from=0 /go/src/system_pay/server ./
# 拷贝配置文件到当前工作目录
# COPY --from=0 /go/src/system_pay/conf ./conf
# 拷贝国际化文件夹到当前工作目录
# COPY --from=0 /go/src/system_pay/i18n ./i18n
# 拷贝国际化文件夹到当前工作目录
# COPY --from=0 /go/src/system_pay/docs ./docs
# 运行打包好的二进制
ENTRYPOINT ./server
\ No newline at end of file
......@@ -6,7 +6,7 @@ runmode = test
autorender = false
copyrequestbody = true
EnableDocs = true
httpport = 9093
httpport = 14999
sessionon = true
#数据库配置
......
version: '3.5'
services:
system_pay_dev:
restart: always
build:
context: .
args:
ENVARG: dev
dockerfile: Dockerfile
image: system_pay:dev
ports:
- 14999:14999
environment:
runmode: dev
networks:
- system_pay_network
container_name: system_data_pay
networks:
system_pay_network:
driver: bridge
{"/Users/wangp/go/src/system_pay/controllers/account":1587983537752490638,"/Users/wangp/go/src/system_pay/controllers/certification":1637914736191257052,"/Users/wangp/go/src/system_pay/controllers/common":1672909668706518832,"/Users/wangp/go/src/system_pay/controllers/coupon":1589449743292364338,"/Users/wangp/go/src/system_pay/controllers/credit":1666332119650014444,"/Users/wangp/go/src/system_pay/controllers/equipment":1619597331058913530,"/Users/wangp/go/src/system_pay/controllers/index":1687167540586756398,"/Users/wangp/go/src/system_pay/controllers/month":1646903306025250067}
\ No newline at end of file
{"/Users/wangp/go/src/system_pay/controllers/index":1687167540586756349}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment