From eccb96dc542986fae71ba974d54e73b767f3bd9a Mon Sep 17 00:00:00 2001 From: "Buster \"Silver Eagle\" Neece" Date: Fri, 1 Oct 2021 19:54:51 -0500 Subject: [PATCH] Use NODE_ENV when building on frontend container. --- Makefile | 4 ++-- frontend/Dockerfile | 2 ++ frontend/webpack.config.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d8b147084..73267f87d 100644 --- a/Makefile +++ b/Makefile @@ -39,9 +39,9 @@ bash: frontend-bash: docker-compose -f frontend/docker-compose.yml build - docker-compose --env-file=.env -f frontend/docker-compose.yml run --rm frontend + docker-compose --env-file=.env -f frontend/docker-compose.yml run -e NODE_ENV=development --rm frontend frontend-build: docker-compose -f frontend/docker-compose.yml build - docker-compose --env-file=.env -f frontend/docker-compose.yml run --rm frontend npm run dev-build + docker-compose --env-file=.env -f frontend/docker-compose.yml run -e NODE_ENV=development --rm frontend npm run dev-build diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 065a8817a..8491f5927 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -24,6 +24,8 @@ USER node:node VOLUME /data/frontend/node_modules +ENV NODE_ENV=production + # Define default command. ENTRYPOINT ["fixuid"] CMD ["npm", "run", "dev"] diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js index 478593f84..7896acc7b 100644 --- a/frontend/webpack.config.js +++ b/frontend/webpack.config.js @@ -4,7 +4,7 @@ const { VueLoaderPlugin } = require('vue-loader'); const path = require('path'); module.exports = { - mode: 'production', + mode: (process.env.NODE_ENV === 'production') ? 'production' : 'development', entry: { Dashboard: '~/pages/Dashboard.js', AdminAuditLog: '~/pages/Admin/AuditLog.js',