인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

jyjjyj06's profile image
jyjjyj06

asked

Learn Docker and CI environment by following [2023.11 update]

Writing Dockerfile for Production Image

도커 이미지 빌드시 에러발생

Written on

·

451

0

FROM node:16-alpine as builder
WORKDIR /practice_react
COPY package.json .
RUN npm install
COPY . .
RUN npm run build
# --from=builder는 as builder로 빌드한 내용을 가져온다는 뜻이고 build되어있는 경로를 첫번쨰로 그다음 그 경로에 있는 파일을 카피할곳을 두번쨰로 둔다
FROM nginx
COPY --from=builder /practice_react/build /usr/share/nginx/html

위의 코드는 제 Dockerfile.dev 파일입니다. 현재 RUN npm run build시 The command '/bin/sh -c npm run build' returned a non-zero code: 1 와 같은 에러를 발생 시키는 상태이며 당연 빌드가 제대로 되지 않았으니 .travis.yml에서 테스트를 위해 npm run test를 했을때도 docker-entrypoint.sh: 38: exec: npm: not found 해당에러를 뱉어냅니다.

dockerawsgithubtravis-ci데이터 엔지니어링cicd

Answer

This question is waiting for answers
Be the first to answer!
jyjjyj06's profile image
jyjjyj06

asked

Ask a question