Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add ui development target #93

Merged
merged 6 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Emnaghz marked this conversation as resolved.
Show resolved Hide resolved
ports:
- 8081:8081

widget:
build:
Expand Down
22 changes: 22 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Emnaghz marked this conversation as resolved.
Show resolved Hide resolved

WORKDIR /app/frontend

CMD ["npm", "run", "dev"]
12 changes: 9 additions & 3 deletions frontend/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Emnaghz marked this conversation as resolved.
Show resolved Hide resolved
}

return config
}),
publicRuntimeConfig: {
lang: {
default: "en",
Expand Down