Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Docker container vue-spree-frontend-1 fails to find rifraf command #239

Open
1 task done
laf0rge opened this issue Jun 20, 2022 · 9 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@laf0rge
Copy link

laf0rge commented Jun 20, 2022

Expected Behavior

I'd expect the instructions to use the dockerized setup to run both the backend and the frontend explained at https://github.com/vuestorefront/spree#running-vue-storefront--spree-in-docker to work

Actual Behavior

  • the bin/setup and bin/seed work as expected
  • for bin/start there is a problem
    ** the docker-compose for the spree backend starts and runs (I can access http://localhost:4000/).
  • the docker-compose for the vue frontend fails
$ docker-compose ps
vue-spree-frontend-1   "docker-entrypoint.s…"   frontend            exited (127)        
$ docker-compose logs
vue-spree-frontend-1  | yarn run v1.22.5
vue-spree-frontend-1  | $ yarn build:api-client && yarn build:composables && yarn build:theme
vue-spree-frontend-1  | $ cd packages/api-client && yarn build
vue-spree-frontend-1  | $ rimraf lib server && rollup -c
vue-spree-frontend-1  | /bin/sh: 1: rimraf: not found
vue-spree-frontend-1  | error Command failed with exit code 127.
vue-spree-frontend-1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
vue-spree-frontend-1  | error Command failed with exit code 127.
vue-spree-frontend-1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
vue-spree-frontend-1  | error Command failed with exit code 127.
vue-spree-frontend-1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
vue-spree-frontend-1  | yarn run v1.22.5
vue-spree-frontend-1  | $ concurrently "yarn:dev:*" --hostname 0.0.0.0
vue-spree-frontend-1  | /bin/sh: 1: concurrently: not found
vue-spree-frontend-1  | error Command failed with exit code 127.
vue-spree-frontend-1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Possible Solution

No response

Steps to reproduce

  • stock debian 11
  • install docker + docker-compose from official (docker-ce) packages

What version of Spree integration are you using?

d1c7335

What version of Node.js are you using?

14.15 (defined by Dockerfile.development)

What browser (and version) are you using?

Firefox, but doesn't matter

What operating system (and version) are you using?

Debian 11

Relevant log output

vue-spree-frontend-1  | yarn run v1.22.5
vue-spree-frontend-1  | $ yarn build:api-client && yarn build:composables && yarn build:theme
vue-spree-frontend-1  | $ cd packages/api-client && yarn build
vue-spree-frontend-1  | $ rimraf lib server && rollup -c
vue-spree-frontend-1  | /bin/sh: 1: rimraf: not found
vue-spree-frontend-1  | error Command failed with exit code 127.
vue-spree-frontend-1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
vue-spree-frontend-1  | error Command failed with exit code 127.
vue-spree-frontend-1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
vue-spree-frontend-1  | error Command failed with exit code 127.
vue-spree-frontend-1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
vue-spree-frontend-1  | yarn run v1.22.5
vue-spree-frontend-1  | $ concurrently "yarn:dev:*" --hostname 0.0.0.0
vue-spree-frontend-1  | /bin/sh: 1: concurrently: not found
vue-spree-frontend-1  | error Command failed with exit code 127.
vue-spree-frontend-1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@laf0rge laf0rge added the bug Something isn't working label Jun 20, 2022
@laf0rge laf0rge changed the title [Bug]: [Bug]: Docker container vue-spree-frontend-1 fails to find rifraf command Jun 20, 2022
@yangyao
Copy link

yangyao commented Jun 30, 2022

same issue

@Con607
Copy link

Con607 commented Aug 4, 2022

Fixed it by adding RUN yarn global add rimraf rollup to Dockerfile.development

FROM node:14.15

WORKDIR /app
ADD . /app/

RUN yarn global add rimraf rollup
RUN yarn

EXPOSE 3000
CMD './docker-entrypoint.development.sh'

And yarn install in docker-entrypoint.develooment.sh

#!/bin/sh
yarn install
yarn build
yarn dev --hostname 0.0.0.0

Not sure it is the right way to do it though.

@rafalcymerys
Copy link
Collaborator

Hi @Con607 - interesting issue, we haven't run into it before. Technically rimraf is included in package.json so it should be installed already. Let me try to reproduce it on a clean install.

@rafalcymerys
Copy link
Collaborator

Hi @Con607 @yangyao I ran a fresh container based on the readme and it launched fine without any issues.
Does it happen for you on a freshly cloned git repo?

@emiliorcueto
Copy link

@rafalcymerys I can confirm this happens on a freshly cloned git repo. @Con607's workaround works insofar as getting the application running

@RocketPuppy
Copy link

The Dockerfile's both run yarn, but they should probably run yarn install to install rimraf and such which are listed as dev dependencies.

@andrewshadura
Copy link

The issue is still valid.

@itforxp
Copy link

itforxp commented Aug 9, 2023

I saw in logs error with husky, it wants to list .git folder. Workaround : remove .git from .dockerignore file
for dev build i changed in Dockerfile.development RUN yarn to RUN yarn install

now bin/start-docker in run-able

@rafalcymerys
Copy link
Collaborator

Interesting. What if you just create a dummy .git directory as a part of the Dockerfile? It may be slightly better than including the full repo in the container image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants