[Docker] lesson 7 < section 6 (Running Multi-container Applications) - error and solution

Hi,

in lesson 7 (build images) of section 6 you will find error of permitions in frontend and backend like:

Missing write access to /app

for this i recommend to change the dockerfile of frontend and backend like this:

frontend:

FROM node:14.16.0-alpine3.13

WORKDIR /app
# added chown -R  app /app
RUN addgroup app && adduser -S -G app app && chown -R  app /app

USER app

COPY package*.json ./
RUN npm install
COPY . .

EXPOSE 3000 

CMD ["npm", "start"]

backend:

FROM node:14.16.0-alpine3.13

WORKDIR /app

RUN addgroup app && adduser -S -G app app && chown -R app /app

USER app


COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 3001

CMD ["npm", "start"]