Skip to content

Commit

Permalink
fix: Fix version file handling in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
3377 committed Dec 17, 2024
1 parent bd841e5 commit 3c166db
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ RUN go mod download

# 复制源代码并构建
COPY . .
RUN go mod tidy
RUN go build -ldflags="-w -s" -o bot
RUN go mod tidy && \
mkdir -p config && \
cp version config/version && \
go build -ldflags="-w -s" -o bot

# 运行阶段
FROM alpine:latest
Expand Down

0 comments on commit 3c166db

Please sign in to comment.