From 6795da8a05aba2cc68e3004dcb8c9b2db56d512e Mon Sep 17 00:00:00 2001 From: Ali Date: Wed, 23 Oct 2024 11:25:47 +0330 Subject: [PATCH] add .env to Dockerfile --- .github/workflows/ghcr.yaml | 1 + Dockerfile | 69 +++++++++++++++++++------------------ 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ghcr.yaml b/.github/workflows/ghcr.yaml index 1f047ad56..1eea2fa18 100644 --- a/.github/workflows/ghcr.yaml +++ b/.github/workflows/ghcr.yaml @@ -65,3 +65,4 @@ jobs: NEXT_PUBLIC_TEXT_DIRECTION: ${{ env.NEXT_PUBLIC_TEXT_DIRECTION}} NEXT_PUBLIC_USE_EXAMPLE_MESSAGES: ${{ env.NEXT_PUBLIC_USE_EXAMPLE_MESSAGES}} NEXT_PUBLIC_USE_FOOTER_CLIENT_TEXT: ${{ env.NEXT_PUBLIC_USE_FOOTER_CLIENT_TEXT}} + SITE_URL: ${{ env.SITE_URL}} diff --git a/Dockerfile b/Dockerfile index 7deb7d978..550c3d4db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,53 +1,56 @@ # Use Node.js 20 as the base image FROM node:20-alpine AS base -ARG OPENAI_API_KEY -ENV OPENAI_API_KEY=$OPENAI_API_KEY +# ARG OPENAI_API_KEY +# ENV OPENAI_API_KEY=$OPENAI_API_KEY -ARG NEXT_PUBLIC_SUPABASE_ANON_KEY -ENV NEXT_PUBLIC_SUPABASE_ANON_KEY=$NEXT_PUBLIC_SUPABASE_ANON_KEY +# ARG NEXT_PUBLIC_SUPABASE_ANON_KEY +# ENV NEXT_PUBLIC_SUPABASE_ANON_KEY=$NEXT_PUBLIC_SUPABASE_ANON_KEY -ARG NEXT_PUBLIC_SUPABASE_BUCKET_NAME -ENV NEXT_PUBLIC_SUPABASE_BUCKET_NAME=$NEXT_PUBLIC_SUPABASE_BUCKET_NAME +# ARG NEXT_PUBLIC_SUPABASE_BUCKET_NAME +# ENV NEXT_PUBLIC_SUPABASE_BUCKET_NAME=$NEXT_PUBLIC_SUPABASE_BUCKET_NAME -ARG NEXT_PUBLIC_SUPABASE_SCHEMA -ENV NEXT_PUBLIC_SUPABASE_SCHEMA=$NEXT_PUBLIC_SUPABASE_SCHEMA +# ARG NEXT_PUBLIC_SUPABASE_SCHEMA +# ENV NEXT_PUBLIC_SUPABASE_SCHEMA=$NEXT_PUBLIC_SUPABASE_SCHEMA -ARG NEXT_PUBLIC_SUPABASE_URL -ENV NEXT_PUBLIC_SUPABASE_URL=$NEXT_PUBLIC_SUPABASE_URL +# ARG NEXT_PUBLIC_SUPABASE_URL +# ENV NEXT_PUBLIC_SUPABASE_URL=$NEXT_PUBLIC_SUPABASE_URL -ARG NEXT_SUPABASE_SERVICE_ROLE_KEY -ENV NEXT_SUPABASE_SERVICE_ROLE_KEY=$NEXT_SUPABASE_SERVICE_ROLE_KEY +# ARG NEXT_SUPABASE_SERVICE_ROLE_KEY +# ENV NEXT_SUPABASE_SERVICE_ROLE_KEY=$NEXT_SUPABASE_SERVICE_ROLE_KEY -ARG OPENAI_ASSISTANT_ID -ENV OPENAI_ASSISTANT_ID=$OPENAI_ASSISTANT_ID +# ARG OPENAI_ASSISTANT_ID +# ENV OPENAI_ASSISTANT_ID=$OPENAI_ASSISTANT_ID -ARG NEXT_PUBLIC_BIZGPT_FRONTEND_LANGUAGE -ENV NEXT_PUBLIC_BIZGPT_FRONTEND_LANGUAGE=$NEXT_PUBLIC_BIZGPT_FRONTEND_LANGUAGE +# ARG NEXT_PUBLIC_BIZGPT_FRONTEND_LANGUAGE +# ENV NEXT_PUBLIC_BIZGPT_FRONTEND_LANGUAGE=$NEXT_PUBLIC_BIZGPT_FRONTEND_LANGUAGE -ARG NEXT_PUBLIC_CLIENT_BRANDING_NAME -ENV NEXT_PUBLIC_CLIENT_BRANDING_NAME=$NEXT_PUBLIC_CLIENT_BRANDING_NAME +# ARG NEXT_PUBLIC_CLIENT_BRANDING_NAME +# ENV NEXT_PUBLIC_CLIENT_BRANDING_NAME=$NEXT_PUBLIC_CLIENT_BRANDING_NAME -ARG NEXT_PUBLIC_EMPTY_TEXT_BODY -ENV NEXT_PUBLIC_EMPTY_TEXT_BODY=$NEXT_PUBLIC_EMPTY_TEXT_BODY +# ARG NEXT_PUBLIC_EMPTY_TEXT_BODY +# ENV NEXT_PUBLIC_EMPTY_TEXT_BODY=$NEXT_PUBLIC_EMPTY_TEXT_BODY -ARG NEXT_PUBLIC_EMPTY_TEXT_HEADER -ENV NEXT_PUBLIC_EMPTY_TEXT_HEADER=$NEXT_PUBLIC_EMPTY_TEXT_HEADER +# ARG NEXT_PUBLIC_EMPTY_TEXT_HEADER +# ENV NEXT_PUBLIC_EMPTY_TEXT_HEADER=$NEXT_PUBLIC_EMPTY_TEXT_HEADER -ARG NEXT_PUBLIC_FOOTER_CLIENT_TEXT -ENV NEXT_PUBLIC_FOOTER_CLIENT_TEXT=$NEXT_PUBLIC_FOOTER_CLIENT_TEXT +# ARG NEXT_PUBLIC_FOOTER_CLIENT_TEXT +# ENV NEXT_PUBLIC_FOOTER_CLIENT_TEXT=$NEXT_PUBLIC_FOOTER_CLIENT_TEXT -ARG NEXT_PUBLIC_OUTLINE_ADDRESS -ENV NEXT_PUBLIC_OUTLINE_ADDRESS=$NEXT_PUBLIC_OUTLINE_ADDRESS +# ARG NEXT_PUBLIC_OUTLINE_ADDRESS +# ENV NEXT_PUBLIC_OUTLINE_ADDRESS=$NEXT_PUBLIC_OUTLINE_ADDRESS -ARG NEXT_PUBLIC_TEXT_DIRECTION -ENV NEXT_PUBLIC_TEXT_DIRECTION=$NEXT_PUBLIC_TEXT_DIRECTION +# ARG NEXT_PUBLIC_TEXT_DIRECTION +# ENV NEXT_PUBLIC_TEXT_DIRECTION=$NEXT_PUBLIC_TEXT_DIRECTION -ARG NEXT_PUBLIC_USE_EXAMPLE_MESSAGES -ENV NEXT_PUBLIC_USE_EXAMPLE_MESSAGES=$NEXT_PUBLIC_USE_EXAMPLE_MESSAGES +# ARG NEXT_PUBLIC_USE_EXAMPLE_MESSAGES +# ENV NEXT_PUBLIC_USE_EXAMPLE_MESSAGES=$NEXT_PUBLIC_USE_EXAMPLE_MESSAGES -ARG NEXT_PUBLIC_USE_FOOTER_CLIENT_TEXT -ENV NEXT_PUBLIC_USE_FOOTER_CLIENT_TEXT=$NEXT_PUBLIC_USE_FOOTER_CLIENT_TEXT +# ARG NEXT_PUBLIC_USE_FOOTER_CLIENT_TEXT +# ENV NEXT_PUBLIC_USE_FOOTER_CLIENT_TEXT=$NEXT_PUBLIC_USE_FOOTER_CLIENT_TEXT + +ARG SITE_URL +ENV SITE_URL=$SITE_URL # Install pnpm RUN npm install -g pnpm @@ -65,7 +68,7 @@ RUN if [ -f pnpm-lock.yaml ]; then pnpm install --frozen-lockfile; \ # Copy the rest of the application code COPY . . - +COPY .env .env # Build the Next.js app RUN pnpm build