You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
600 B
Plaintext
24 lines
600 B
Plaintext
# 构建
|
|
FROM go_base_image:latest as build
|
|
|
|
# 设置工作目录
|
|
WORKDIR /joybuywork
|
|
|
|
COPY . .
|
|
|
|
RUN go build -o joybuywork ./cmd/joybuywork/joybuywork.go
|
|
|
|
FROM scratch as final
|
|
|
|
# 设置时区为上海
|
|
COPY --from=build /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai
|
|
ENV TZ=Asia/Shanghai
|
|
|
|
COPY --from=build /joybuywork/joybuywork /
|
|
COPY --from=build /joybuywork/asset/ /asset/
|
|
COPY --from=build /joybuywork/etc/ /etc/
|
|
COPY --from=build /joybuywork/tmp/ /tmp/
|
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
|
|
ENTRYPOINT [ "/joybuywork", "-env" ]
|
|
CMD ["prod"] |