From 449f3735b8fb09caba173dbcc4b07a8e40e8e922 Mon Sep 17 00:00:00 2001 From: Susith Rupasinghe Date: Tue, 13 Aug 2024 17:10:45 +0530 Subject: [PATCH] Update Dockerfile with env injection --- Dockerfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3c5c665..1b0c59d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,6 +42,16 @@ ENV NODE_ENV production # Learn more here: https://nextjs.org/telemetry ENV NEXT_TELEMETRY_DISABLED 1 +ENV NEXT_PUBLIC_FIREBASE_API_KEY=${NEXT_PUBLIC_FIREBASE_API_KEY} +ENV NEXT_PUBLIC_AUTH_DOMAIN=${NEXT_PUBLIC_AUTH_DOMAIN} +ENV NEXT_PUBLIC_PROJECT_ID=${NEXT_PUBLIC_PROJECT_ID} +ENV NEXT_PUBLIC_STORAGE_BUCKET=${NEXT_PUBLIC_STORAGE_BUCKET} +ENV NEXT_PUBLIC_MESSAGING_SENDER_ID=${NEXT_PUBLIC_MESSAGING_SENDER_ID} +ENV NEXT_PUBLIC_APP_ID=${NEXT_PUBLIC_APP_ID} +ENV NEXT_PUBLIC_MEASUREMENT_ID=${NEXT_PUBLIC_MEASUREMENT_ID} +ENV NEXT_PUBLIC_FIREBASE_COLLECTION_PREFIX=${NEXT_PUBLIC_FIREBASE_COLLECTION_PREFIX} +ENV NEXT_PUBLIC_EMAIL_ENDPOINT=${NEXT_PUBLIC_EMAIL_ENDPOINT} + # Set correct permissions for nextjs user and don't run as root RUN addgroup nodejs RUN adduser -SDH nextjs @@ -63,4 +73,4 @@ ENV HOSTNAME "0.0.0.0" HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD [ "wget", "-q0", "http://localhost:3000/health" ] # Run the nextjs app -CMD ["node", "server.js"] \ No newline at end of file +CMD ["node", "server.js"]