diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index 98c7912e..7742b661 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -41,7 +41,17 @@ services: build: context: ../ dockerfile: ./frontend/Dockerfile + target: development pull_policy: build + environment: + - NODE_ENV=development + - CHOKIDAR_USEPOLLING=true + - WATCHPACK_POLLING=true + volumes: + - ../frontend/src:/app/src + - ../frontend/src/components:/app/src/components + ports: + - 8081:8081 widget: build: diff --git a/frontend/Dockerfile b/frontend/Dockerfile index d8d812c6..c704d801 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -73,3 +73,25 @@ ENV PORT 8080 # server.js is created by next build from the standalone output # https://nextjs.org/docs/pages/api-reference/next-config-js/output CMD HOSTNAME="0.0.0.0" node server.js + +FROM base AS development + +WORKDIR /app + +COPY --from=deps /app/node_modules ./node_modules +COPY --from=deps /app/package.json ./package.json +COPY --from=deps /app/package-lock.json ./package-lock.json +COPY ./widget ./widget +COPY ./frontend ./frontend +COPY --from=deps /app/widget/node_modules ./widget/node_modules +COPY --from=deps /app/frontend/node_modules ./frontend/node_modules + +ENV NODE_ENV=development +ENV CHOKIDAR_USEPOLLING=true +ENV WATCHPACK_POLLING=true + +EXPOSE 8081 + +WORKDIR /app/frontend + +CMD ["npm", "run", "dev"] \ No newline at end of file diff --git a/frontend/next.config.mjs b/frontend/next.config.mjs index 6d0080df..567a49d1 100644 --- a/frontend/next.config.mjs +++ b/frontend/next.config.mjs @@ -10,9 +10,15 @@ const nextConfig = withTM(["hexabot-widget"])({ }, ]; }, - webpack(config, _options) { - return config; - }, + webpack: (config => { + config.watchOptions = { + poll: 1000, + aggregateTimeout: 300, + // ignored: ['**/node_modules'] + } + +return config + }), publicRuntimeConfig: { lang: { default: "en",