add .env file into docker image
This commit is contained in:
+5
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user