From 5632ab93b46b40e3bd39df92b0e8bbe1b7ced3bc Mon Sep 17 00:00:00 2001 From: Kaung Zin Hein Date: Sun, 20 Oct 2024 17:51:28 -0400 Subject: [PATCH] feat(client): Add services to docker-compose for hot-reload --- client-admin/Dockerfile | 2 +- client-admin/webpack.config.js | 9 +++++++++ docker-compose.dev.yml | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/client-admin/Dockerfile b/client-admin/Dockerfile index 3e51120f9..6dc79f29a 100644 --- a/client-admin/Dockerfile +++ b/client-admin/Dockerfile @@ -22,4 +22,4 @@ RUN npm ci --production=false COPY . . -CMD npm run build:prod +CMD npm start diff --git a/client-admin/webpack.config.js b/client-admin/webpack.config.js index c5c64e1fe..5218131f2 100644 --- a/client-admin/webpack.config.js +++ b/client-admin/webpack.config.js @@ -47,6 +47,15 @@ module.exports = (env, options) => { }, }, **/ + + port: 3000, + proxy: [ + {context: ['/api'], + target: 'http://127.0.0.1:5000/', + secure: false, + changeOrigin: true, + } + ] }, plugins: [ new CopyPlugin({ diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 0aa471343..c969c44cb 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -62,3 +62,21 @@ services: # live-code-reloaded ports # * leave the server pointing to the static builds, but have separate ports you can hit for the live-code # reloading (making sure to document the process) + + client-admin: + build: + context: ./client-admin + dockerfile: Dockerfile + args: + NODE_ENV: development + environment: + CHOKIDAR_USEPOLLING: "true" + volumes: + - ./client-admin:/app + - /app/node_modules + ports: + - "3000:3000" + networks: + - "polis-net" + +