Skip to content

Commit

Permalink
Merge pull request #93 from Emnaghz/feat/configure-ui-dev-mode
Browse files Browse the repository at this point in the history
fix: add ui development target
  • Loading branch information
marrouchi authored Sep 29, 2024
2 parents 2f2379d + 1aae30d commit 604dd5a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
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

Check warning on line 68 in frontend/Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-push

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

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

0 comments on commit 604dd5a

Please sign in to comment.