Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hotfix: Changed ownership of
.next
and node_modules
folder to con…
…tainer's default non-root user `node` Error Log: client | [Error: EACCES: permission denied, open '/usr/src/app/client/.next/package.json'] { client | errno: -13, client | code: 'EACCES', client | syscall: 'open', client | path: '/usr/src/app/client/.next/package.json' client | } References: node.js - How to keep node_modules inside container while using docker-compose and a non-root user? - Stack Overflow https://stackoverflow.com/questions/49941708/how-to-keep-node-modules-inside-container-while-using-docker-compose-and-a-non-r https://stackoverflow.com/a/49952703 https://stackoverflow.com/questions/49941708/how-to-keep-node-modules-inside-container-while-using-docker-compose-and-a-non-r/49952703#49952703 Docker Compose mounts named volumes as 'root' exclusively · Issue #3270 · docker/compose · GitHub docker/compose#3270 Stuck with a Problem of access permission denied · Issue #8908 · vercel/next.js · GitHub vercel/next.js#8908 vercel/next.js#8908 (comment) What is the best way to use NextJS with docker? · Discussion #16995 · vercel/next.js · GitHub vercel/next.js#16995 reactjs - error An unexpected error occurred: "EACCES: permission denied - Stack Overflow https://stackoverflow.com/questions/52713928/error-an-unexpected-error-occurred-eacces-permission-denied docker - Dockerfile with nextjs and puppteer permission denied - Stack Overflow https://stackoverflow.com/questions/64565062/dockerfile-with-nextjs-and-puppteer-permission-denied [RUN chown -Rh $user:$user /home/node] https://stackoverflow.com/a/64922590 https://stackoverflow.com/questions/64565062/dockerfile-with-nextjs-and-puppteer-permission-denied/64922590#64922590 [More relevant for production build, suggests we modify next.config.js by adding a distDir directive: module.exports = { distDir: 'build', serverRuntimeConfig: { // Will only be available on the server side apiUrl: 'http://signup-api:1984' }, publicRuntimeConfig: { // Will be available on both server and client apiUrl: 'http://localhost:1984' } } ]
- Loading branch information