Merge pull request #93 from Emnaghz/feat/configure-ui-dev-mode

fix: add ui development target
This commit is contained in:
Mohamed Marrouchi 2024-09-29 09:54:06 +01:00 committed by GitHub
commit 604dd5aa0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 33 additions and 4 deletions

View File

@ -58,6 +58,7 @@ jobs:
file: ./frontend/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
target: production
tags: hexastack/hexabot-ui:latest
- name: Build and push API Docker image

View File

@ -41,7 +41,10 @@ services:
build:
context: ../
dockerfile: ./frontend/Dockerfile
target: development
pull_policy: build
volumes:
- ../frontend/:/app/frontend/
widget:
build:

View File

@ -41,11 +41,29 @@ RUN \
else echo "Lockfile not found." && exit 1; \
fi
# Production image, copy all the files and run next
FROM base AS runner
FROM base AS development
WORKDIR /app
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
COPY . .
RUN npm install
ENV NODE_ENV=development
ENV CHOKIDAR_USEPOLLING=true
ENV WATCHPACK_POLLING=true
WORKDIR /app/frontend
ENV NODE_ENV production
CMD ["npm", "run", "dev", "--", "-p", "8080"]
# Production image, copy all the files and run next
FROM base AS production
WORKDIR /app/frontend
ENV NODE_ENV=production
# Uncomment the following line in case you want to disable telemetry during runtime.
ENV NEXT_TELEMETRY_DISABLED 1

View File

@ -10,7 +10,14 @@ const nextConfig = withTM(["hexabot-widget"])({
},
];
},
webpack(config, _options) {
webpack(config) {
if (process.env.NODE_ENV==="development") {
config.watchOptions = {
poll: 1000,
aggregateTimeout: 300,
};
}
return config;
},
publicRuntimeConfig: {