Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
fix: 修复环境变量在构建时没有正确传递的 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hamster1963 committed Oct 8, 2023
1 parent cd3c79c commit cf52156
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ FROM base AS runner
WORKDIR /app

ARG NEXT_PUBLIC_GO_API_BASE_URL=default_value
ENV NEXT_PUBLIC_GO_API_BASE_URL=$NEXT_PUBLIC_GO_API_BASE_URL

ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
Expand All @@ -37,6 +36,8 @@ COPY --from=builder /app/public ./public

COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
# Appends to .env.production
RUN printf "$NEXT_PUBLIC_GO_API_BASE_URL" >> .env.production

USER nextjs

Expand Down

0 comments on commit cf52156

Please sign in to comment.