esbuildやsassが見つからないというエラー

実現したいこと

Dockerfileからdocker-composeしてビルドすると、対象のコンテナで
esbuildやsassが見つからないというエラーが起こってしまいます。
対処法のご教示をお願いします。
なお、事情により、NodeとRubyでコンテナを分けないことを考えています。

発生している問題・エラーメッセージ

対象のコンテナのエラー

web.1 | with pid 10 js.1 | with pid 12 css.1 | with pid 13 js.1 | run v1.22.19 css.1 | run v1.22.19 js.1 | ../package.json: No license field css.1 | ../package.json: No license field js.1 | esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets --watch css.1 | sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules --watch js.1 | 1: esbuild: not found css.1 | 1: sass: not found js.1 | Command failed with exit code 127. js.1 | Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. css.1 | Command failed with exit code 127. css.1 | Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. js.1 | with code 127 system | SIGTERM to all processes css.1 | with code 127 web.1 | by SIGTERM

試したこと

esbuildやsassをaddしてみましたが、エラーメッセージは変わらなかったです。

Dockerfile

1FROM ruby:3.1.2 2RUN apt-get update -qq \ 3 && curl -sL https://deb.nodesource.com/setup_current.x | bash - \ 4 && apt-get install -y nodejs \ 5 && rm -rf /var/lib/apt/lists/* \ 6 && npm install --global yarn \ 7 && yarn add esbuild \ 8 && yarn add sass 9 10WORKDIR /my-api-v1 11COPY Gemfile /my-api-v1/Gemfile 12COPY Gemfile.lock /my-api-v1/Gemfile.lock 13 14RUN gem update --system 15RUN bundle update --bundler 16RUN gem install rails 17 18COPY . /my-api-v1

補足情報(FW/ツールのバージョンなど)

Windows 10
Docker Desktop

コメントを投稿

0 コメント