Issue with cross-env to build an image
Hi, I'm trying to build a new image with the current code before apply any change on settings.json and build my image.
I copied docker-compose.dev.yml to docker-compose-production.yml change the lines:
- target: production
- NODE_ENV: production
Set all the he variables DOCKER_COMPOSE... and ran:
docker compose -f docker-compose-production.yml up -d
but I'm getting this:
# docker container logs etherpad-lite-app-1
> [email protected] prod /opt/etherpad-lite
> pnpm --filter ep_etherpad-lite run prod
> [email protected] prod /opt/etherpad-lite/src
> cross-env NODE_ENV=production node --require tsx/cjs node/server.ts
sh: cross-env: not found
/opt/etherpad-lite/src:
ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL [email protected] prod: `cross-env NODE_ENV=production node --require tsx/cjs node/server.ts`
spawn ENOENT
WARN Local package.json exists, but node_modules missing, did you mean to install?
ELIFECYCLE Command failed with exit code 1.
Any suggestion about What I can do to fix it?
Best regards,
Hi, I'm trying to build a new image with the current code before apply any change on settings.json and build my image.
I copied
docker-compose.dev.ymltodocker-compose-production.ymlchange the lines:
- target: production
- NODE_ENV: production
Set all the he variables
DOCKER_COMPOSE...and ran:
docker compose -f docker-compose-production.yml up -dbut I'm getting this:
# docker container logs etherpad-lite-app-1 > [email protected] prod /opt/etherpad-lite > pnpm --filter ep_etherpad-lite run prod > [email protected] prod /opt/etherpad-lite/src > cross-env NODE_ENV=production node --require tsx/cjs node/server.ts sh: cross-env: not found /opt/etherpad-lite/src: ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL [email protected] prod: `cross-env NODE_ENV=production node --require tsx/cjs node/server.ts` spawn ENOENT WARN Local package.json exists, but node_modules missing, did you mean to install? ELIFECYCLE Command failed with exit code 1.Any suggestion about What I can do to fix it?
Best regards,
Hi could you try the normal docker-compose.yml instead of the dev one? Dev was only meant for local development in docker and I think it maps the local directory with node_modules into the container. So if you didn't install it manually from outside the container the node_modules won't be there.
Thanks, it worked.
I thought I had tried to use docker-compose.yml to run the container before and it had failled. But I realized now I hadn't.
I will modify the Dockerfile and try build it.