I just started working with docker today and am blocked on a permissions issue. I don't know what I should be entering to switch the permission. I am assuming it's a chown thing. There are other questions on stack overflow but they did not help me as they were either not Docker specific or did not have a selected answer to the question.
Below is the error
client_1 |
client_1 | > client@0.1.0 start
client_1 | > react-scripts start
client_1 |
client_1 | ℹ 「wds」: Project is running at http://172.19.0.2/
client_1 | ℹ 「wds」: webpack output is served from
client_1 | ℹ 「wds」: Content not from webpack is served from /app/public
client_1 | ℹ 「wds」: 404s will fallback to /
client_1 | Starting the development server...
client_1 |
client_1 | Failed to compile.
client_1 |
client_1 | EACCES: permission denied, mkdir '/app/node_modules/.cache'
My docker-compose.yml looks like this:
version: "3"
services:
client:
stdin_open: true
build:
context: .
dockerfile: Dockerfile.dev
ports:
- "3000:3000"
volumes:
- "/app/node_modules"
- "./:/app"
My Dockerfile.dev looks like this:
FROM node:alpine
RUN apk update && apk add git && apk add python make g++
WORKDIR /app
COPY package.json /app
# To Fix Permissions for Packages
RUN npm config set unsafe-perm true
RUN npm install --force
COPY . /app
CMD ["npm", "run", "start"]