Skip to content

Commit

Permalink
feat: build args and .env cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
KotaHusky committed Mar 27, 2024
1 parent 498718f commit 9464548
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ jobs:
push: true
tags: index.docker.io/${{ env.DOCKER_IMAGE_NAME }}:${{ github.sha }}
context: .
build-args:
NODE_VERSION: ${{ env.NODE_VERSION }}
NEXT_PUBLIC_AZURE_AD_CLIENT_ID=${{ secrets.NEXT_PUBLIC_AZURE_AD_CLIENT_ID }}
NEXT_PUBLIC_AZURE_AD_TENANT_ID=${{ secrets.NEXT_PUBLIC_AZURE_AD_TENANT_ID }}
NEXT_PUBLIC_REDIRECT_URI=${{ secrets.NEXT_PUBLIC_REDIRECT_URI }}

deploy:
runs-on: ubuntu-latest
Expand Down
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM node:18-alpine as runner
ARG NODE_VERSION
FROM node:${NODE_VERSION} as runner
WORKDIR /app

# RUN ls -la ./apps/msal-react-demo/

COPY ./package.json package-lock.json ./
COPY ./apps/msal-react-demo/next.config.js ./
COPY ./apps/msal-react-demo/.next ./.next
Expand All @@ -12,8 +11,12 @@ RUN npm ci

EXPOSE 3000

ENV NEXT_PUBLIC_AZURE_AD_CLIENT_ID=bb626b2e-8bd8-44ee-bb90-afc1959a9274
ENV NEXT_PUBLIC_AZURE_AD_TENANT_ID=5e3f37f1-3b80-467a-a949-70b4cd2c4ac0
ENV NEXT_PUBLIC_REDIRECT_URI=/auth
ARG NEXT_PUBLIC_AZURE_AD_CLIENT_ID
ARG NEXT_PUBLIC_AZURE_AD_TENANT_ID
ARG NEXT_PUBLIC_REDIRECT_URI

ENV NEXT_PUBLIC_AZURE_AD_CLIENT_ID=$NEXT_PUBLIC_AZURE_AD_CLIENT_ID
ENV NEXT_PUBLIC_AZURE_AD_TENANT_ID=$NEXT_PUBLIC_AZURE_AD_TENANT_ID
ENV NEXT_PUBLIC_REDIRECT_URI=$NEXT_PUBLIC_REDIRECT_URI

CMD ["npx", "next", "start", "-p", "3000"]
3 changes: 0 additions & 3 deletions apps/msal-react-demo/.env.local

This file was deleted.

3 changes: 0 additions & 3 deletions apps/msal-react-demo/.env.prod

This file was deleted.

0 comments on commit 9464548

Please sign in to comment.