diff --git a/dashboard/serve.js b/dashboard/serve.js index 5bb473d6..f63fc3ab 100644 --- a/dashboard/serve.js +++ b/dashboard/serve.js @@ -17,3 +17,9 @@ fastify.listen({ port: 3002, host: '0.0.0.0' }, (err, address) => { } console.log(`Server listening on ${address}`); }); + +process.on("SIGTERM", () => { + fastify.close().then(() => { + process.exit(0); + }); +}); diff --git a/dashboard/webpack.config.js b/dashboard/webpack.config.js index 54b45cba..6766cbaa 100644 --- a/dashboard/webpack.config.js +++ b/dashboard/webpack.config.js @@ -153,6 +153,7 @@ let config = { new DotenvPlugin({ path: path.resolve(process.cwd(), "../.env"), }), + new webpack.EnvironmentPlugin(["API_URL"]), ], resolve: { extensions: [".ts", ".tsx", ".js", ".mjs", ".vue"], @@ -161,8 +162,6 @@ let config = { }, }; -if (process.env.NODE_ENV === "web") config.plugins.push(new webpack.EnvironmentPlugin(["NODE_ENV", "API_URL"])); - if (process.env.NODE_ENV === "production") { config = merge(config, { mode: "production",