refactor: update NODE_ENV handling in Dockerfile and docker-compose.yml for better environment configuration
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ FROM node:22-alpine AS runner
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV $NODE_ENV
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
ENV NEXT_TELEMETRY_DISABLED 1
|
||||||
|
|
||||||
# Add a non-root user for security
|
# Add a non-root user for security
|
||||||
|
|||||||
+8
-2
@@ -27,6 +27,8 @@ export async function generateMetadata() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function RootLayout({ children }) {
|
export default function RootLayout({ children }) {
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<html lang="fa" dir="rtl" suppressHydrationWarning>
|
<html lang="fa" dir="rtl" suppressHydrationWarning>
|
||||||
<head>
|
<head>
|
||||||
@@ -36,14 +38,18 @@ export default function RootLayout({ children }) {
|
|||||||
/>
|
/>
|
||||||
</head>
|
</head>
|
||||||
<ThemeRegistry>
|
<ThemeRegistry>
|
||||||
<GoogleTagManager gtmId="GTM-NXBSV7GS" />
|
{process.env.NODE_ENV !== 'development' && (
|
||||||
|
<GoogleTagManager gtmId="GTM-NXBSV7GS" />
|
||||||
|
)}
|
||||||
<body className="bg-[#FAFAFA]">
|
<body className="bg-[#FAFAFA]">
|
||||||
<ProvinceProvider>
|
<ProvinceProvider>
|
||||||
<Providers>{children}</Providers>
|
<Providers>{children}</Providers>
|
||||||
</ProvinceProvider>
|
</ProvinceProvider>
|
||||||
<CustomToastify />
|
<CustomToastify />
|
||||||
</body>
|
</body>
|
||||||
<GoogleAnalytics gaId="G-HG3RZ1PJS5" />
|
{process.env.NODE_ENV !== 'development' && (
|
||||||
|
<GoogleAnalytics gaId="G-HG3RZ1PJS5" />
|
||||||
|
)}
|
||||||
</ThemeRegistry>
|
</ThemeRegistry>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
|
|||||||
+2
-1
@@ -7,7 +7,7 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
args:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=${NODE_ENV}
|
||||||
- NEXT_TELEMETRY_DISABLED=1
|
- NEXT_TELEMETRY_DISABLED=1
|
||||||
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||||
- NEXT_PUBLIC_CLIENT_ID=${NEXT_PUBLIC_CLIENT_ID}
|
- NEXT_PUBLIC_CLIENT_ID=${NEXT_PUBLIC_CLIENT_ID}
|
||||||
@@ -22,3 +22,4 @@ services:
|
|||||||
- NEXT_PUBLIC_CLIENT_ID=${NEXT_PUBLIC_CLIENT_ID}
|
- NEXT_PUBLIC_CLIENT_ID=${NEXT_PUBLIC_CLIENT_ID}
|
||||||
- NEXT_PUBLIC_CLIENT_SECRET=${NEXT_PUBLIC_CLIENT_SECRET}
|
- NEXT_PUBLIC_CLIENT_SECRET=${NEXT_PUBLIC_CLIENT_SECRET}
|
||||||
- APP_PORT=${APP_PORT}
|
- APP_PORT=${APP_PORT}
|
||||||
|
- NODE_ENV=${NODE_ENV}
|
||||||
|
|||||||
Reference in New Issue
Block a user