@@ -12,8 +12,8 @@ WORKDIR /go/release | |||||
# 把全部文件添加到/go/release目录 | # 把全部文件添加到/go/release目录 | ||||
ADD . . | ADD . . | ||||
# 编译:把main.go编译成可执行的二进制文件,命名为zyos | |||||
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -tags netgo -ldflags="-s -w" -installsuffix cgo -o zyos main.go | |||||
# 编译:把main.go编译成可执行的二进制文件,命名为egg | |||||
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 | FROM ubuntu:xenial as prod | ||||
LABEL maintainer="dengbiao" | LABEL maintainer="dengbiao" | ||||
@@ -25,12 +25,12 @@ RUN rm -f /etc/localtime \ | |||||
&& ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ | && ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ | ||||
&& echo "Asia/Shanghai" > /etc/timezone | && echo "Asia/Shanghai" > /etc/timezone | ||||
# 在build阶段复制可执行的go二进制文件app | # 在build阶段复制可执行的go二进制文件app | ||||
COPY --from=build /go/release/zyos ./zyos | |||||
COPY --from=build /go/release/egg ./egg | |||||
COPY --from=build /go/release/etc/cfg.yml /var/zyos/cfg.yml | |||||
COPY --from=build /go/release/etc/cfg.yml /var/egg/cfg.yml | |||||
# 启动服务 | # 启动服务 | ||||
# CMD ["./zyos","-c","/var/zyos/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 && ./zyos -c /var/zyos/cfg.yml"] | |||||
# CMD ["./egg","-c","/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"] | |||||
@@ -1,20 +1,21 @@ | |||||
apiVersion: networking.k8s.io/v1 | |||||
kind: Ingress | kind: Ingress | ||||
apiVersion: networking.k8s.io/v1 | |||||
metadata: | metadata: | ||||
name: egg-app-ddxqapi.ddstaros.com | |||||
namespace: egg | |||||
annotations: | annotations: | ||||
cert-manager.io/cluster-issuer: letsencrypt-prod | cert-manager.io/cluster-issuer: letsencrypt-prod | ||||
kubesphere.io/creator: dengbiao | |||||
name: advertisement | |||||
namespace: advertisement | |||||
kubesphere.io/creator: admin | |||||
spec: | spec: | ||||
ingressClassName: nginx | |||||
rules: | rules: | ||||
- host: '*.adcms.zhiyingos.cn' | |||||
- host: ddxqapi.ddstaros.com | |||||
http: | http: | ||||
paths: | paths: | ||||
- backend: | |||||
- path: / | |||||
pathType: ImplementationSpecific | |||||
backend: | |||||
service: | service: | ||||
name: advertisement | |||||
name: egg-app | |||||
port: | port: | ||||
number: 80 | number: 80 | ||||
path: / | |||||
pathType: ImplementationSpecific |
@@ -0,0 +1,65 @@ | |||||
# 当前域名 | |||||
debug: true | |||||
curldebug: true | |||||
prd: true | |||||
local: false | |||||
# 服务器参数 | |||||
srv_addr: ':4011' | |||||
# 缓存 | |||||
redis_addr: 'r-bp1ds703d4evh588uf.redis.rds.aliyuncs.com:6379' | |||||
redis_password: '' | |||||
db: | |||||
host: 'pc-bp1r00x3256zw9b35.rwlb.rds.aliyuncs.com:3306' | |||||
name: 'egg' | |||||
user: 'zhios' | |||||
psw: 'ZHIoscnfnuo123@' | |||||
show_log: true | |||||
max_lifetime: 30 | |||||
max_open_conns: 100 | |||||
max_idle_conns: 100 | |||||
path: 'tmp/%s.log' | |||||
im_db: | |||||
host: 'pc-bp1r00x3256zw9b35.rwlb.rds.aliyuncs.com:3306' | |||||
name: 'egg-im' | |||||
user: 'zhios' | |||||
psw: 'ZHIoscnfnuo123@' | |||||
show_log: true | |||||
max_lifetime: 30 | |||||
max_open_conns: 100 | |||||
max_idle_conns: 100 | |||||
path: 'tmp/%s.log' | |||||
# 日志 | |||||
log: | |||||
app_name: 'applet' | |||||
level: 'debug' # 普通日志级别 #debug, info, warn, fatal, panic | |||||
is_stdout: true | |||||
time_format: 'standard' # sec, second, milli, nano, standard, iso | |||||
encoding: 'console' | |||||
is_file_out: true | |||||
file_dir: './tmp/' | |||||
file_max_size: 256 | |||||
file_max_age: 1 | |||||
file_name: 'debug.log' | |||||
# 连接RabbitMq | |||||
mq: | |||||
host: '116.62.62.35' | |||||
port: '5672' | |||||
user: 'zhios' | |||||
pwd: 'ZHIoscnfnuo123' | |||||
es: | |||||
url: 'http://120.55.48.175:9200' | |||||
user: 'elastic' | |||||
pwd: 'fnuo123' | |||||
im_business_rpc: | |||||
url: im-rpc-business.izhim.com | |||||
port: 1005 | |||||
im_logic_rpc: | |||||
url: im-rpc-logic.izhim.com | |||||
port: 1008 |
@@ -0,0 +1,21 @@ | |||||
kind: Ingress | |||||
apiVersion: networking.k8s.io/v1 | |||||
metadata: | |||||
name: egg-app-ddxqffapi.ddstaros.com | |||||
namespace: egg | |||||
annotations: | |||||
cert-manager.io/cluster-issuer: letsencrypt-prod | |||||
kubesphere.io/creator: admin | |||||
spec: | |||||
ingressClassName: nginx | |||||
rules: | |||||
- host: ddxqffapi.ddstaros.com | |||||
http: | |||||
paths: | |||||
- path: / | |||||
pathType: ImplementationSpecific | |||||
backend: | |||||
service: | |||||
name: egg-app | |||||
port: | |||||
number: 80 |
@@ -0,0 +1,21 @@ | |||||
kind: Ingress | |||||
apiVersion: networking.k8s.io/v1 | |||||
metadata: | |||||
name: egg-app-ddxqlhffapi.ddstaros.com | |||||
namespace: egg | |||||
annotations: | |||||
cert-manager.io/cluster-issuer: letsencrypt-prod | |||||
kubesphere.io/creator: admin | |||||
spec: | |||||
ingressClassName: nginx | |||||
rules: | |||||
- host: ddxqlhffapi.ddstaros.com | |||||
http: | |||||
paths: | |||||
- path: / | |||||
pathType: ImplementationSpecific | |||||
backend: | |||||
service: | |||||
name: egg-app | |||||
port: | |||||
number: 80 |
@@ -0,0 +1,21 @@ | |||||
kind: Ingress | |||||
apiVersion: networking.k8s.io/v1 | |||||
metadata: | |||||
name: egg-app-ddxqyhffapi.ddstaros.com | |||||
namespace: egg | |||||
annotations: | |||||
cert-manager.io/cluster-issuer: letsencrypt-prod | |||||
kubesphere.io/creator: admin | |||||
spec: | |||||
ingressClassName: nginx | |||||
rules: | |||||
- host: ddxqyhffapi.ddstaros.com | |||||
http: | |||||
paths: | |||||
- path: / | |||||
pathType: ImplementationSpecific | |||||
backend: | |||||
service: | |||||
name: egg-app | |||||
port: | |||||
number: 80 |