diff --git a/Dockerfile b/Dockerfile index 11d63f6c..b8a0d2d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ COPY --from=deps leCoffre-front/node_modules ./node_modules COPY --from=deps leCoffre-front/package.json package.json COPY tsconfig.json tsconfig.json COPY src src +COPY .env .env RUN npm run build @@ -34,6 +35,7 @@ WORKDIR leCoffre-front RUN adduser -D lecoffreuser --uid 10000 && chown -R lecoffreuser . COPY public ./public +COPY --from=builder --chown=lecoffreuser leCoffre-front/.env ./.env COPY --from=builder --chown=lecoffreuser leCoffre-front/node_modules ./node_modules COPY --from=builder --chown=lecoffreuser leCoffre-front/.next ./.next COPY --from=builder --chown=lecoffreuser leCoffre-front/package.json ./package.json diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index b9424204..a2e09430 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -66,19 +66,20 @@ const MyApp = (({ MyApp.getInitialProps = async () => { console.log("runtime config", publicRuntimeConfig); console.log("server runtime config", serverRuntimeConfig); + console.log("process env", process.env['NEXT_PUBLIC_BACK_API_PROTOCOL'] || "env undefined"); return { - backApiProtocol: serverRuntimeConfig.NEXT_PUBLIC_BACK_API_PROTOCOL, - backApiHost: serverRuntimeConfig.NEXT_PUBLIC_BACK_API_HOST, - backApiRootUrl: serverRuntimeConfig.NEXT_PUBLIC_BACK_API_ROOT_URL, - backApiVersion: serverRuntimeConfig.NEXT_PUBLIC_BACK_API_VERSION, - frontAppHost: serverRuntimeConfig.NEXT_PUBLIC_FRONT_APP_HOST, - frontAppPort: serverRuntimeConfig.NEXT_PUBLIC_FRONT_APP_PORT, - idNotBaseUrl: serverRuntimeConfig.NEXT_PUBLIC_IDNOT_BASE_URL, - idNotAuthorizeEndpoint: serverRuntimeConfig.NEXT_PUBLIC_IDNOT_AUTHORIZE_ENDPOINT, - idNotClientId: serverRuntimeConfig.NEXT_PUBLIC_IDNOT_CLIENT_ID, - fcAuthorizeEndpoint: serverRuntimeConfig.NEXT_PUBLIC_FC_AUTHORIZE_ENDPOINT, - fcClientId: serverRuntimeConfig.NEXT_PUBLIC_FC_CLIENT_ID, - docaposteApiUrl: serverRuntimeConfig.NEXT_PUBLIC_DOCAPOST_API_URL, + backApiProtocol: publicRuntimeConfig.NEXT_PUBLIC_BACK_API_PROTOCOL, + backApiHost: publicRuntimeConfig.NEXT_PUBLIC_BACK_API_HOST, + backApiRootUrl: publicRuntimeConfig.NEXT_PUBLIC_BACK_API_ROOT_URL, + backApiVersion: publicRuntimeConfig.NEXT_PUBLIC_BACK_API_VERSION, + frontAppHost: publicRuntimeConfig.NEXT_PUBLIC_FRONT_APP_HOST, + frontAppPort: publicRuntimeConfig.NEXT_PUBLIC_FRONT_APP_PORT, + idNotBaseUrl: publicRuntimeConfig.NEXT_PUBLIC_IDNOT_BASE_URL, + idNotAuthorizeEndpoint: publicRuntimeConfig.NEXT_PUBLIC_IDNOT_AUTHORIZE_ENDPOINT, + idNotClientId: publicRuntimeConfig.NEXT_PUBLIC_IDNOT_CLIENT_ID, + fcAuthorizeEndpoint: publicRuntimeConfig.NEXT_PUBLIC_FC_AUTHORIZE_ENDPOINT, + fcClientId: publicRuntimeConfig.NEXT_PUBLIC_FC_CLIENT_ID, + docaposteApiUrl: publicRuntimeConfig.NEXT_PUBLIC_DOCAPOST_API_URL, }; };