mirror of
https://github.com/GMWalletApp/epusdt.git
synced 2026-07-07 10:16:15 +00:00
add .env file into docker image
This commit is contained in:
@@ -50,5 +50,7 @@ jobs:
|
|||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
build-args: |
|
||||||
|
API_RATE_URL=${{ vars.API_RATE_URL }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|||||||
+5
-1
@@ -5,7 +5,7 @@ ENV CGO_ENABLED=0
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN git clone https://github.com/GMwalletApp/epusdt.git .
|
COPY . /app
|
||||||
|
|
||||||
WORKDIR /app/src
|
WORKDIR /app/src
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
@@ -14,11 +14,15 @@ RUN go build -o /app/epusdt .
|
|||||||
FROM alpine:latest AS runner
|
FROM alpine:latest AS runner
|
||||||
ENV TZ=Asia/Shanghai
|
ENV TZ=Asia/Shanghai
|
||||||
RUN apk --no-cache add ca-certificates tzdata
|
RUN apk --no-cache add ca-certificates tzdata
|
||||||
|
ARG API_RATE_URL=""
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=builder /app/src/static /app/static
|
COPY --from=builder /app/src/static /app/static
|
||||||
COPY --from=builder /app/src/static /static
|
COPY --from=builder /app/src/static /static
|
||||||
COPY --from=builder /app/src/.env.example /app/.env
|
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 .
|
COPY --from=builder /app/epusdt .
|
||||||
|
|
||||||
VOLUME /app/conf
|
VOLUME /app/conf
|
||||||
|
|||||||
Reference in New Issue
Block a user