构建镜像
This commit is contained in:
parent
2ea309c6ad
commit
fbf1cdb2e0
10
Dockerfile
10
Dockerfile
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.21.10-alpine AS builder
|
FROM renzhiyuan123/go-zero1.21.11:base AS builder
|
||||||
|
|
||||||
LABEL stage=gobuilder
|
LABEL stage=gobuilder
|
||||||
|
|
||||||
|
@ -11,12 +11,8 @@ RUN go mod download
|
||||||
RUN go build -ldflags="-s -w" -o /src/cmd/rpc/transfer cmd/rpc/transfer.go
|
RUN go build -ldflags="-s -w" -o /src/cmd/rpc/transfer cmd/rpc/transfer.go
|
||||||
RUN go build -ldflags="-s -w" -o /src/cmd/rpc/queue/queue cmd/rpc/queue/queue.go
|
RUN go build -ldflags="-s -w" -o /src/cmd/rpc/queue/queue cmd/rpc/queue/queue.go
|
||||||
|
|
||||||
FROM alpine:latest AS runtime
|
FROM registry.cn-chengdu.aliyuncs.com/go_ls/go-zero:v1 AS runtime
|
||||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
|
||||||
RUN apk update && apk add supervisor
|
|
||||||
RUN apk add make
|
|
||||||
|
|
||||||
ENV TZ Asia/Shanghai
|
|
||||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||||
COPY --from=builder /src /src
|
COPY --from=builder /src /src
|
||||||
|
|
||||||
|
@ -28,4 +24,4 @@ ADD ./sh/supervisord.conf /etc/supervisord.conf
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
EXPOSE 10001
|
EXPOSE 10001
|
||||||
#CMD ["sh","/opt/startup.sh"]
|
CMD ["sh","/opt/startup.sh"]
|
Loading…
Reference in New Issue