I get the following error in the last step:
unable to convert uid/gid chown string to host mapping: can't find uid for user node: no such user: node Any ideas? thanks
I found that removing the "--chown=node:node" part of the last COPY command solves the issue. But I wonder if it is going to cause other issues.
FROM node:lts as base ENV NPM_CONFIG_LOGLEVEL=warn ENV NPM_CONFIG_COLOR=false WORKDIR /app COPY . ./ RUN yarn install RUN yarn build FROM nginx:stable-alpine COPY nginx.conf /etc/nginx/conf.d/configfile.template ENV PORT 3000 ENV HOST 0.0.0.0 WORKDIR /home/node/app RUN sh -c "envsubst '\$PORT' < /etc/nginx/conf.d/configfile.template > /etc/nginx/conf.d/default.conf" COPY --from=base /app/build /usr/share/nginx/html EXPOSE 3000 CMD ["nginx", "-g", "daemon off;"]
I simplified mine to just do production version and it worked.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I get the following error in the last step:
I found that removing the "--chown=node:node" part of the last COPY command solves the issue.
But I wonder if it is going to cause other issues.
I simplified mine to just do production version and it worked.