• Home
  • About
    • lahuman photo

      lahuman

      열심히 사는 아저씨

    • Learn More
    • Facebook
    • LinkedIn
    • Github
  • Posts
    • All Posts
    • All Tags
  • Projects

Docker image로 vue build 시 오류 원인

19 Oct 2020

Reading time ~1 minute

Docker image로 vue build 시 오류 원인

갑자기 빌드시 아래와 같은 오류가 발생했습니다.

원인은 yarn 설치시 NODE_ENV 를 production으로 설정되어 발생합니다.

I found my problem. I was inadvertently setting NODE_ENV to production in my docker-compose so all NPM dev dependencies (including vue-cli-service) were not being installed.

를 보면, yarn install 시 vue-cli-servie를 설치 하지 않아서 발생합니다.

해결 방법으로는 ENV (환경변수)를 yarn install 후 build 하기 전에 설정하세요

해결 된 Dockerfile

RUN npm install -g yarn
RUN yarn install

ENV NODE_ENV production
RUN yarn build

참고 자료

  • I found my problem. I was inadvertently setting NODE_ENV to production in my docker-compose so all NPM dev dependencies (including vue-cli-service) were not being installed.


vuedockerbuild Share Tweet +1