dengbiao 3 недель назад
Родитель
Сommit
d834b29360
4 измененных файлов: 15 добавлений и 16 удалений
  1. +5
    -5
      Dockerfile_business
  2. +5
    -5
      Dockerfile_connect
  3. +5
    -5
      Dockerfile_logic
  4. +0
    -1
      internal/business/api/business_ext_test.go

+ 5
- 5
Dockerfile_business Просмотреть файл

@@ -12,8 +12,8 @@ WORKDIR /go/release
# 把全部文件添加到/go/release目录
ADD . .

# 编译:把main.go编译成可执行的二进制文件,命名为zyos
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -o zyos cmd/business/main.go
# 编译:把main.go编译成可执行的二进制文件,命名为egg_im
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -o egg_im cmd/business/main.go

FROM ubuntu:xenial as prod
LABEL maintainer="dengbiao"
@@ -25,7 +25,7 @@ RUN rm -f /etc/localtime \
&& echo $TZ > /etc/timezone

# 在build阶段复制可执行的go二进制文件app
COPY --from=build /go/release/zyos ./zyos
COPY --from=build /go/release/egg_im ./egg_im

# 启动服务
# 优化内核参数
@@ -33,5 +33,5 @@ COPY --from=build /go/release/zyos ./zyos
#RUN sysctl -w net.ipv4.tcp_tw_recycle=1
#RUN sysctl -w net.ipv4.ip_local_port_range=1024 65535
#RUN sysctl -p
#CMD ["bash","-c","sysctl -w net.ipv4.tcp_timestamps=1 && sysctl -w net.ipv4.tcp_tw_reuse=1 && sysctl -w net.ipv4.tcp_tw_timeout=10 && sysctl -w net.ipv4.tcp_fin_timeout=10 && sysctl -w net.ipv4.ip_local_port_range='1024 65535' && ./zyos"]
CMD ["./zyos"]
#CMD ["bash","-c","sysctl -w net.ipv4.tcp_timestamps=1 && sysctl -w net.ipv4.tcp_tw_reuse=1 && sysctl -w net.ipv4.tcp_tw_timeout=10 && sysctl -w net.ipv4.tcp_fin_timeout=10 && sysctl -w net.ipv4.ip_local_port_range='1024 65535' && ./egg_im"]
CMD ["./egg_im"]

+ 5
- 5
Dockerfile_connect Просмотреть файл

@@ -12,8 +12,8 @@ WORKDIR /go/release
# 把全部文件添加到/go/release目录
ADD . .

# 编译:把main.go编译成可执行的二进制文件,命名为zyos
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -o zyos cmd/connect/main.go
# 编译:把main.go编译成可执行的二进制文件,命名为egg_im
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -o egg_im cmd/connect/main.go

FROM ubuntu:xenial as prod
LABEL maintainer="dengbiao"
@@ -25,7 +25,7 @@ RUN rm -f /etc/localtime \
&& echo $TZ > /etc/timezone

# 在build阶段复制可执行的go二进制文件app
COPY --from=build /go/release/zyos ./zyos
COPY --from=build /go/release/egg_im ./egg_im

# 启动服务
# 优化内核参数
@@ -33,5 +33,5 @@ COPY --from=build /go/release/zyos ./zyos
#RUN sysctl -w net.ipv4.tcp_tw_recycle=1
#RUN sysctl -w net.ipv4.ip_local_port_range=1024 65535
#RUN sysctl -p
#CMD ["bash","-c","sysctl -w net.ipv4.tcp_timestamps=1 && sysctl -w net.ipv4.tcp_tw_reuse=1 && sysctl -w net.ipv4.tcp_tw_timeout=10 && sysctl -w net.ipv4.tcp_fin_timeout=10 && sysctl -w net.ipv4.ip_local_port_range='1024 65535' && ./zyos"]
CMD ["./zyos"]
#CMD ["bash","-c","sysctl -w net.ipv4.tcp_timestamps=1 && sysctl -w net.ipv4.tcp_tw_reuse=1 && sysctl -w net.ipv4.tcp_tw_timeout=10 && sysctl -w net.ipv4.tcp_fin_timeout=10 && sysctl -w net.ipv4.ip_local_port_range='1024 65535' && ./egg_im"]
CMD ["./egg_im"]

+ 5
- 5
Dockerfile_logic Просмотреть файл

@@ -12,8 +12,8 @@ WORKDIR /go/release
# 把全部文件添加到/go/release目录
ADD . .

# 编译:把main.go编译成可执行的二进制文件,命名为zyos
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -o zyos cmd/logic/main.go
# 编译:把main.go编译成可执行的二进制文件,命名为egg_im
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -o egg_im cmd/logic/main.go

FROM ubuntu:xenial as prod
LABEL maintainer="dengbiao"
@@ -25,7 +25,7 @@ RUN rm -f /etc/localtime \
&& echo $TZ > /etc/timezone

# 在build阶段复制可执行的go二进制文件app
COPY --from=build /go/release/zyos ./zyos
COPY --from=build /go/release/egg_im ./egg_im

# 启动服务
# 优化内核参数
@@ -33,5 +33,5 @@ COPY --from=build /go/release/zyos ./zyos
#RUN sysctl -w net.ipv4.tcp_tw_recycle=1
#RUN sysctl -w net.ipv4.ip_local_port_range=1024 65535
#RUN sysctl -p
#CMD ["bash","-c","sysctl -w net.ipv4.tcp_timestamps=1 && sysctl -w net.ipv4.tcp_tw_reuse=1 && sysctl -w net.ipv4.tcp_tw_timeout=10 && sysctl -w net.ipv4.tcp_fin_timeout=10 && sysctl -w net.ipv4.ip_local_port_range='1024 65535' && ./zyos"]
CMD ["./zyos"]
#CMD ["bash","-c","sysctl -w net.ipv4.tcp_timestamps=1 && sysctl -w net.ipv4.tcp_tw_reuse=1 && sysctl -w net.ipv4.tcp_tw_timeout=10 && sysctl -w net.ipv4.tcp_fin_timeout=10 && sysctl -w net.ipv4.ip_local_port_range='1024 65535' && ./egg_im"]
CMD ["./egg_im"]

+ 0
- 1
internal/business/api/business_ext_test.go Просмотреть файл

@@ -34,7 +34,6 @@ func TestUserExtServer_SignIn(t *testing.T) {
resp, err := getBusinessExtClient().SignIn(getCtx(), &pb.SignInReq{
PhoneNumber: "18229775311",
DeviceId: 1,
MasterId: 123456,
})
if err != nil {
fmt.Println(err)


Загрузка…
Отмена
Сохранить