Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
Out of memory error when running nginx react and node with docker
I am using the 5 dollar plan to host mongodb, nginx, react node through docker and docker compose. The problem I have is that it keeps giving me
The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
This image building starts with the backend and then react where this error occurs. The specific line it occurs is at
Step 5/9 : RUN yarn build ---> Running in e12af022dcf1 yarn run v1.22.5 $ react-scripts build Creating an optimized production build...
I am using the multi-stage docker build for react and nginx
FROM node:alpine as build WORKDIR /usr/app COPY ./client . RUN yarn install RUN yarn build FROM nginx:alpine RUN rm /etc/nginx/conf.d/default.conf COPY ./nginx/nginx.conf /etc/nginx/nginx.conf COPY --from=build /usr/app/build /usr/share/nginx/html ``
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×