A
A
Anton Misyagin2019-01-23 12:40:49
Node.js
Anton Misyagin, 2019-01-23 12:40:49

Is nodejs visible or not visible inside the docker container?

I run the compiled image based on the official ruby: 2.5.3, go to its console and do:

[email protected]#node -v
v.8.15.0

Those. we see that the node is worth it. Next, I try to compile the assets. Here webpacker should connect and do its dirty work:
[email protected]#RAILS_ENV=staging bundle exec rake assets:precompile

but I get:
Compiling…
Compilation failed:
/usr/local/bin/ruby: warning: shebang line ending with \r may cause problems
warning package.json: No license field
/usr/bin/env: 'node\r': No such file or directory

[email protected]# which node
/usr/local/bin/node

dockerfile:
FROM ruby:2.5.3
ENV APP_HOME /project
RUN mkdir $APP_HOME
WORKDIR $APP_HOME
COPY ./Gemfile $APP_HOME
COPY ./Gemfile.lock $APP_HOME
ENV BUNDLE_PATH /bundle
RUN curl -sL https://deb.nodesource.com/setup_8.x |   bash -
RUN apt-get install -y nodejs imagemagick jpegoptim optipng unzip
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install yarn
RUN bundle install --without development test --jobs 4
RUN gem install foreman
RUN yarn install
CMD tail -f /dev/null

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2019-01-23
@Zarom

warning: shebang line ending with \r may cause problems

Are you editing files in Windows? All \r must be removed :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question