transfer_rs/Dockerfile

33 lines
688 B
Docker
Raw Normal View History

2024-06-20 16:32:19 +08:00
FROM registry.cn-chengdu.aliyuncs.com/go_ls/go-zero:v1 AS builder
2024-06-18 18:14:57 +08:00
LABEL stage=gobuilder
ENV CGO_ENABLED 0
ENV GOPROXY https://goproxy.cn,direct
2024-06-18 18:33:34 +08:00
2024-06-19 10:55:54 +08:00
WORKDIR /src
2024-06-18 18:14:57 +08:00
COPY ../.. .
2024-06-19 10:55:54 +08:00
RUN go mod tidy
2024-06-18 18:14:57 +08:00
RUN go build -ldflags="-s -w" -o /src/cmd/api/transfer cmd/api/transfer.go
2024-06-20 16:32:19 +08:00
FROM registry.cn-chengdu.aliyuncs.com/go_ls/alpha:v1 AS runtime
2024-06-18 18:14:57 +08:00
2024-06-18 18:33:34 +08:00
2024-06-18 18:14:57 +08:00
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
2024-06-20 17:25:29 +08:00
2024-06-18 18:33:34 +08:00
ENV TZ Asia/Shanghai
2024-06-18 18:14:57 +08:00
COPY --from=builder /src /src
2024-06-18 18:33:34 +08:00
2024-06-18 18:14:57 +08:00
RUN mkdir "/var/log/supervisor"
2024-06-18 18:33:34 +08:00
2024-06-18 18:14:57 +08:00
ADD ./sh/startup.sh /opt/startup.sh
RUN sed -i 's/\r//g' /opt/startup.sh
ADD ./sh/supervisord.conf /etc/supervisord.conf
WORKDIR /src
2024-06-18 18:23:48 +08:00
EXPOSE 10101
2024-06-18 18:14:57 +08:00
#CMD ["sh","/opt/startup.sh"]