dengbiao преди 2 седмици
родител
ревизия
8e4d6c3496
променени са 2 файла, в които са добавени 7 реда и са изтрити 9 реда
  1. +1
    -3
      Dockerfile-prd
  2. +6
    -6
      Dockerfile-task

+ 1
- 3
Dockerfile-prd Целия файл

@@ -6,7 +6,6 @@ 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"
ENV PHONE_DATA_DIR="./static/bat"
# 设置工作区
WORKDIR /go/release

@@ -17,9 +16,8 @@ ADD . .
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -tags netgo -ldflags="-s -w" -installsuffix cgo -o zyos main.go

FROM ubuntu:xenial as prod
LABEL maintainer="zengzhengrong"
LABEL maintainer="dengbiao"
ENV TZ="Asia/Shanghai"
ENV PHONE_DATA_DIR="./static/bat"

COPY static/html static/html
COPY static/bat static/bat


+ 6
- 6
Dockerfile-task Целия файл

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

# 编译:把main.go编译成可执行的二进制文件,命名为zyos
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -tags netgo -ldflags="-s -w" -installsuffix cgo -o zyos_mall_task cmd/task/main.go
# 编译:把main.go编译成可执行的二进制文件,命名为egg
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -tags netgo -ldflags="-s -w" -installsuffix cgo -o egg_task cmd/task/main.go

FROM ubuntu:xenial as prod
LABEL maintainer="wuhanqin"
LABEL maintainer="dengbiao"
ENV TZ="Asia/Shanghai"

COPY static/html static/html
@@ -25,10 +25,10 @@ RUN rm -f /etc/localtime \
&& ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone
# 在build阶段复制可执行的go二进制文件app
COPY --from=build /go/release/zyos_mall_task ./zyos_mall_task
COPY --from=build /go/release/egg_task ./egg_task

COPY --from=build /go/release/etc/task.yml /var/zyos/task.yml
COPY --from=build /go/release/etc/task.yml /var/egg/task.yml

# 启动服务
CMD ["./zyos_mall_task","-c","/var/zyos/task.yml"]
CMD ["./egg_task","-c","/var/egg/task.yml"]


Зареждане…
Отказ
Запис