-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from kia678/patch-1
Update Dockerfile
- Loading branch information
Showing
1 changed file
with
8 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
FROM golang:1.23.1 AS builder | ||
FROM golang:1.23.2-alpine3.20 AS builder | ||
|
||
ENV GO111MODULE=on | ||
WORKDIR /go/release | ||
ADD . . | ||
RUN set -x \ | ||
&& CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -buildid=" -o bepusdt ./main | ||
|
||
FROM debian:latest | ||
FROM alpine:3.20 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV DEBCONF_NOWARNINGS="yes" | ||
ENV TZ=Asia/Shanghai | ||
|
||
COPY --from=builder /go/release/bepusdt /runtime/bepusdt | ||
# 安装所需的依赖 | ||
RUN apk add --no-cache tzdata ca-certificates | ||
|
||
COPY --from=builder /go/release/bepusdt /runtime/bepusdt | ||
ADD ./templates /runtime/templates | ||
ADD ./static /runtime/static | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends tzdata ca-certificates libc6 libgcc1 libstdc++6 \ | ||
&& ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ | ||
&& dpkg-reconfigure -f noninteractive tzdata \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* | ||
# 设置时区 | ||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | ||
|
||
EXPOSE 8080 | ||
CMD ["/runtime/bepusdt"] | ||
CMD ["/runtime/bepusdt"] |