From 9049294d468f1de0d1ea141e6b300be59012e79f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A0=EB=AF=B8=EB=9D=BC?= Date: Thu, 28 Nov 2024 01:46:08 +0900 Subject: [PATCH] Chore: configure ARG for build-time environment variables --- Dockerfile.nginx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Dockerfile.nginx b/Dockerfile.nginx index cf47f3b1..1658a35f 100644 --- a/Dockerfile.nginx +++ b/Dockerfile.nginx @@ -6,15 +6,12 @@ WORKDIR /app COPY . . -RUN pnpm install --frozen-lockfile && VITE_API_URL=$VITE_API_URL VITE_SOCKET_URL=$VITE_SOCKET_URL pnpm build - -FROM nginx:alpine - ARG VITE_API_URL ARG VITE_SOCKET_URL -ENV VITE_API_URL=$VITE_API_URL -ENV VITE_SOCKET_URL=$VITE_SOCKET_URL +RUN pnpm install --frozen-lockfile && VITE_API_URL=$VITE_API_URL VITE_SOCKET_URL=$VITE_SOCKET_URL pnpm build + +FROM nginx:alpine COPY nginx.conf /etc/nginx/templates/default.conf.template COPY --from=builder /app/client/dist /usr/share/nginx/html