diff --git a/rails-dev-Dockerfile b/rails-dev-Dockerfile index 564a628..e34c624 100644 --- a/rails-dev-Dockerfile +++ b/rails-dev-Dockerfile @@ -13,8 +13,13 @@ ADD Gemfile* /tmp/ WORKDIR /tmp RUN bundle install --without production +RUN npm install -g lineman +ADD frontend/package.json /tmp/ +RUN npm install + RUN mkdir /rails WORKDIR /rails +RUN cp -a /tmp/node_modules /rails/frontend/node_modules VOLUME ["/rails"] EXPOSE 3000 diff --git a/rails-prod-Dockerfile b/rails-prod-Dockerfile index 385ef79..7570a87 100644 --- a/rails-prod-Dockerfile +++ b/rails-prod-Dockerfile @@ -50,6 +50,10 @@ COPY Gemfile Gemfile COPY Gemfile.lock Gemfile.lock RUN bundle install --without test +#Cache node_modules +WORKDIR /tmp +COPY frontend/package.json package.json +RUN npm install # Copy site into place. RUN rm -rf /var/www @@ -74,7 +78,8 @@ RUN echo PassengerMaxPoolSize 3 >> /etc/apache2/apache2.conf RUN echo PassengerMinInstances 3 >> /etc/apache2/apache2.conf RUN echo PassengerPreStart *:443 >> /etc/apache2/apache2.conf - +#Copy node_modules to /var/www +RUN cp -a /tmp/node_modules /var/www/frontend/node_modules # By default, simply start apache. CMD /usr/sbin/apache2ctl -D FOREGROUND