2024-07-06 22:35:16 +08:00
|
|
|
ARG registry=registry.cn-hangzhou.aliyuncs.com/syschan
|
|
|
|
FROM ${registry}/golang:alpine as builder
|
2024-07-06 21:36:40 +08:00
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
|
|
RUN go generate && source ./bin/start/.env && go build -o ./bin/$appName -v .
|
|
|
|
|
2024-07-06 22:35:16 +08:00
|
|
|
FROM ${registry}/alpine:latest
|
2024-07-06 21:36:40 +08:00
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/bin/ .
|
|
|
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk add bash && chmod +x ./start/script.sh
|
|
|
|
CMD ["bash","-c","./start/script.sh"]
|