Install libxss1 for the test image, looks like it is needed by Chrome
[discourse_docker.git] / image / discourse_test / Dockerfile
index 2297e6f1212e89f0b2da85e272714a4aac03ab14..48f6ac818519d6dc3c44e9513389f401cedb65cc 100644 (file)
@@ -1,25 +1,35 @@
-FROM samsaffron/discourse_21:2.1.2.1
+# NAME:     discourse/discourse_test
+# VERSION:  release
+ARG tag=build
+FROM discourse/base:$tag
+ENV RAILS_ENV test
 
 MAINTAINER Sam Saffron "https://twitter.com/samsaffron"
 
-RUN apt-get install -y vim &&\
-      wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2 &&\
-      tar -xjf phantomjs-1.9.7-linux-x86_64.tar.bz2 &&\
-      rm phantomjs-1.9.7-linux-x86_64.tar.bz2 &&\
-      cp phantomjs-1.9.7-linux-x86_64/bin/phantomjs /bin/phantomjs &&\
-      rm -fr phantomjs-1.9.7-linux-x86_64
+# configure Git to suppress warnings
+RUN sudo -E -u discourse -H git config --global user.email "you@example.com" &&\
+    sudo -E -u discourse -H git config --global user.name "Your Name"
 
-RUN cd /var/www/discourse &&\
+RUN gem update bundler --force &&\
+      cd /var/www/discourse &&\
       chown -R discourse . &&\
       rm -fr .bundle &&\
       sudo -u discourse git pull &&\
-      sudo -u discourse bundle install --standalone &&\
-      chown -R discourse /var/run/postgresql
+      sudo -u discourse bundle install --standalone --jobs=4
 
-# RUN cd /var/www/discourse &&\
-#      sudo -u discourse git pull &&\
-#      sudo -u discourse bundle install --standalone
+RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - &&\
+    echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list &&\
+    curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - &&\
+    echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list &&\
+    apt update &&\
+    apt install -y libgconf-2-4 libxss1 google-chrome-stable yarn nodejs &&\
+    npm install -g eslint babel-eslint &&\
+    cd /var/www/discourse && sudo -E -u discourse -H yarn install
+
+RUN cd /var/www/discourse && sudo -E -u discourse -H bundle exec rake plugin:install_all_official &&\
+    sudo -E -u discourse -H bundle exec rake plugin:install_all_gems &&\
+    chown -R discourse /var/run/postgresql
 
 WORKDIR /var/www/discourse
 ENV LANG en_US.UTF-8
-ENTRYPOINT sudo -E -u discourse ruby script/docker_test.rb
+ENTRYPOINT sudo -E -u discourse -H ruby script/docker_test.rb