|
|
@@ -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"] |