Skip to content

Commit

Permalink
Chore: configure ARG for build-time environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
유미라 authored and 유미라 committed Nov 27, 2024
1 parent f5c2675 commit 9049294
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Dockerfile.nginx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9049294

Please sign in to comment.