mirror of
https://github.com/hexastack/hexabot
synced 2025-01-22 10:35:37 +00:00
fix: add ui production target + improve code
This commit is contained in:
parent
615402c88b
commit
c2f6b5af7b
1
.github/workflows/docker.yml
vendored
1
.github/workflows/docker.yml
vendored
@ -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
|
||||
|
@ -49,8 +49,6 @@ services:
|
||||
- WATCHPACK_POLLING=true
|
||||
volumes:
|
||||
- ../frontend/:/app/frontend/
|
||||
ports:
|
||||
- 8081:8081
|
||||
|
||||
widget:
|
||||
build:
|
||||
|
@ -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
|
||||
|
||||
@ -73,23 +91,3 @@ 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 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
|
||||
|
||||
EXPOSE 8081
|
||||
|
||||
WORKDIR /app/frontend
|
||||
|
||||
CMD ["npm", "run", "dev"]
|
@ -10,15 +10,16 @@ const nextConfig = withTM(["hexabot-widget"])({
|
||||
},
|
||||
];
|
||||
},
|
||||
webpack: (config => {
|
||||
config.watchOptions = {
|
||||
poll: 1000,
|
||||
aggregateTimeout: 300,
|
||||
// ignored: ['**/node_modules']
|
||||
webpack(config) {
|
||||
if(process.env.NODE_ENV=="development"){
|
||||
config.watchOptions = {
|
||||
poll: 1000,
|
||||
aggregateTimeout: 300,
|
||||
};
|
||||
}
|
||||
|
||||
return config
|
||||
}),
|
||||
|
||||
return config;
|
||||
},
|
||||
publicRuntimeConfig: {
|
||||
lang: {
|
||||
default: "en",
|
||||
|
Loading…
Reference in New Issue
Block a user