Dockerized CRA fails to run because of Craco?

Viewed 148

I'm trying to dockerize a CRA and later on integrate in my docker-compose alongside other containers. It seems like the container fails to run because of Craco? Here's the error output.

docker run -p 7070:3000 je12emy/app

> @beextravel/beex-mobile-pwa@0.0.1 start /app
> cross-env SKIP_PREFLIGHT_CHECK=true craco start

events.js:377
      throw er; // Unhandled 'error' event
      ^

Error: spawn craco ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:467:16)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:467:16)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn craco',
  path: 'craco',
  spawnargs: [ 'start' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @beextravel/beex-mobile-pwa@0.0.1 start: `cross-env SKIP_PREFLIGHT_CHECK=true craco start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @beextravel/beex-mobile-pwa@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-08-20T18_52_28_750Z-debug.log

This is my dockerfile.

FROM node:14-alpine

# set working directory
WORKDIR /app

# install app dependencies
COPY package.json .
RUN npm install
RUN npm install cross-env -g

# add app
COPY . ./

# start app
CMD ["npm","run","start"]
0 Answers
Related