|
1234567891011121314151617181920212223242526272829303132333435 |
-
-
- FROM registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/golang:1.18.4 as build
-
-
- ENV GO111MODULE=on
- ENV GOPROXY=https://goproxy.cn,direct
- ENV TZ="Asia/Shanghai"
-
- WORKDIR /go/release
-
-
- ADD . .
-
-
- RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -tags netgo -ldflags="-s -w" -installsuffix cgo -o egg main.go
-
- FROM ubuntu:xenial as prod
- LABEL maintainer="dengbiao"
- ENV TZ="Asia/Shanghai"
-
- COPY static/html static/html
-
- RUN rm -f /etc/localtime \
- && ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
- && echo "Asia/Shanghai" > /etc/timezone
-
- COPY --from=build /go/release/egg ./egg
-
- COPY --from=build /go/release/etc/cfg.yml /var/egg/cfg.yml
-
-
- CMD ["bash","-c","sysctl -w net.ipv4.tcp_tw_reuse=1 && sysctl -w net.ipv4.tcp_fin_timeout=10 && sysctl -w net.ipv4.ip_local_port_range='1024 65535' && sysctl -p && ./egg -c /var/egg/cfg.yml"]
-
-
|