add .env file into docker image

This commit is contained in:
Ginta
2026-04-22 22:00:51 +08:00
parent b625bac1e3
commit 27d5e5bcfe
2 changed files with 7 additions and 1 deletions
+5 -1
View File
@@ -5,7 +5,7 @@ ENV CGO_ENABLED=0
WORKDIR /app
RUN git clone https://github.com/GMwalletApp/epusdt.git .
COPY . /app
WORKDIR /app/src
RUN go mod download
@@ -14,11 +14,15 @@ RUN go build -o /app/epusdt .
FROM alpine:latest AS runner
ENV TZ=Asia/Shanghai
RUN apk --no-cache add ca-certificates tzdata
ARG API_RATE_URL=""
WORKDIR /app
COPY --from=builder /app/src/static /app/static
COPY --from=builder /app/src/static /static
COPY --from=builder /app/src/.env.example /app/.env
RUN if [ -n "$API_RATE_URL" ]; then \
sed -i "s|^api_rate_url=.*$|api_rate_url=${API_RATE_URL}|" /app/.env; \
fi
COPY --from=builder /app/epusdt .
VOLUME /app/conf