Skip to content

Commit

Permalink
Merge pull request #35 from kia678/patch-1
Browse files Browse the repository at this point in the history
Update Dockerfile
  • Loading branch information
v03413 authored Oct 9, 2024
2 parents 295e5e0 + 90ec084 commit 05b72dd
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Dockerfile
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"]

0 comments on commit 05b72dd

Please sign in to comment.