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 all commits
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
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ services:
build:
context: ../
dockerfile: ./frontend/Dockerfile
target: development
pull_policy: build
volumes:
- ../frontend/:/app/frontend/

widget:
build:
Expand Down
22 changes: 20 additions & 2 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,29 @@ RUN \
else echo "Lockfile not found." && exit 1; \
fi

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

CMD ["npm", "run", "dev", "--", "-p", "8080"]

# Production image, copy all the files and run next
FROM base AS runner
FROM base AS production
WORKDIR /app/frontend

ENV NODE_ENV production
ENV NODE_ENV=production
# Uncomment the following line in case you want to disable telemetry during runtime.
ENV NEXT_TELEMETRY_DISABLED 1

Expand Down
9 changes: 8 additions & 1 deletion frontend/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down