-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Webpack build fails on node:16-alpine docker base image #9504
Comments
please share the whole project and the steps to reproduce your issue. |
I've checked this morning and FROM node:16-alpine
COPY package*.json
RUN npm ci
COPY . .
RUN npx nest build --webpack
CMD ["npm","run","start:prod"] |
Added a branch to an example project |
I can confirm this does happen, it seems like it's related to |
Correct me if I'm wrong but docker has access to all system ram, right? Also, how do I set this max old space size variable? |
You're right, I was reading through errors too quickly. This is a recursive error in webpack for some reason, increasing the max-old-space-size most likely won't fix the issue either. I wonder what plugin with webpack is causing this issue. |
As I understand it, the
|
Thanks! I'll give it a try |
Setting the workdir worked for me, Is there a reason for this behavior? |
I can only assume what As we have a solution, and this is not related directly to Nest, I'm going to close this out |
Is there an existing issue for this?
Current behavior
I'm trying to take advantage of multi-stage builds in docker and I wanted to use webpack to bundle my code and dependencies together in ./dist but I get the following error when building my dockerfile
When I use
nest build --webpack
from the windows command line it builds perfectly fine but it fails in the node:16-alpine docker imageMinimum reproduction code
https://gist.github.com/ThatNerdUKnow/926655d5462142e2b7b3096974581c60
Steps to reproduce
Dockerfile:
NPM Script
Expected behavior
I expect nest build --webpack to behave the same on docker as it does on my local system. On my system nest builds main.js under ./dist but in docker I get the aforementioned error
Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
@nestjs/cli
NestJS version
8.0.9
Packages versions
Node.js version
16-alpine
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: