From b5d2c66731d442801b760bf25ba18affe1845ca2 Mon Sep 17 00:00:00 2001 From: PandaX <18610165312@163.com> Date: Tue, 12 Nov 2024 08:02:06 +0000 Subject: [PATCH] update Dockerfile. Signed-off-by: PandaX <18610165312@163.com> --- Dockerfile | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8eea20a..64971bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,23 @@ + +FROM golang:1.23.0-alpine AS builder + +WORKDIR /app + +COPY . . + +RUN go env -w GOPROXY=https://goproxy.cn,direct && go mod download + +RUN go build -o pandax + + FROM alpine:latest LABEL MAINTAINER="PandaX" -WORKDIR /go/src/panda -COPY ./pandax ./ -COPY ./config.yml ./ -COPY ./resource ./resource -COPY ./uploads ./uploads +WORKDIR /pandax +COPY --from=builder /app/pandax ./ +COPY --from=builder /app/config.yml ./ +COPY --from=builder /app/resource ./resource +COPY --from=builder /app/uploads ./uploads RUN chmod 755 ./pandax