refinedev / refine

A React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility.
https://refine.dev
MIT License
28.64k stars 2.24k forks source link

[BUG] Docker build fails #6489

Closed gabosvk closed 1 week ago

gabosvk commented 1 week ago

Describe the bug

Building refine app for production in docker gets stuck for dozens of minutes

Steps To Reproduce

  1. Dockerize refine application
  2. Run docker build for Dockerfile specified in refinedev github repo
  3. Wait till the process goes to row RUN npm run build
  4. Build is completed in several seconds (app. 30 seconds)
  5. After that, build is stuck for 15 minutes

Expected behavior

Creating docker image finishes shortly after npm run build

Packages

"@refinedev/antd": "^5.44.0", "@refinedev/cli": "^2.16.39", "@refinedev/core": "^4.56.0", "@refinedev/devtools": "^1.2.9", "@refinedev/inferencer": "^4.7.1", "@refinedev/kbar": "^1.3.12", "@refinedev/react-router-v6": "^4.6.0", "@refinedev/simple-rest": "^5.0.8",

Additional Context

The whole application build and deployment is part of a CICD pipeline defined in GitLab. Docker images are built using kaniko. Every time a build is executed, a new build container is spawned where the Dockerfile instructions are being executed by kaniko.

The application finishes the build phase (in app. 30 seconds) with the following output:

tsc -b && refine build (node:119) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) vite v5.4.11 building for production... transforming... [plugin:vite:resolve] [plugin vite:resolve] Module "fs" has been externalized for browser compatibility, imported by "/app/refine/node_modules/casbin/lib/esm/enforcer.js". See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details. ✓ 10515 modules transformed. rendering chunks... computing gzip size... dist/index.html 1.43 kB │ gzip: 0.68 kB dist/assets/index-B6snAd4S.css 2.97 kB │ gzip: 1.19 kB dist/assets/index-CSrEYHIK.js 3,368.44 kB │ gzip: 1,029.78 kB (!) Some chunks are larger than 500 kB after minification. Consider:

After this point it gets stuck for 15-20 minutes a

When exploring the container where the kaniko build is running I see a process node /app/refine/node_modules/.bin/refine build still hanging there even after the build has finished based on log output - therefore I assume the refine build can't finish for some reason and continue with rest of the dockerfile instructions.

BatuhanW commented 1 week ago

Hello @gabosvk thanks for creating the issue. I think this problem isn't specific to Refine, but probably with your app configuration, dependencies or CI process. You can ask AI Chatbot in our documentation to get some help.

Closing the issue fornow, but if you can pin down issue to a some specific problem with Refine code, you can re-open the issue.