Dockerfile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. FROM ubuntu:16.04
  2. RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -y dist-upgrade && DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -y install unzip software-properties-common
  3. RUN add-apt-repository ppa:openjdk-r/ppa && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -y install openjdk-7-jdk
  4. RUN mkdir -p /opt/torquebox /home/torquebox/oadr
  5. ADD deps/torquebox-dist-3.0.2-bin.tar.gz /opt/torquebox
  6. RUN useradd --no-create-home --shell /bin/bash --home-dir /home/torquebox torquebox
  7. COPY app /home/torquebox/oadr/app/
  8. COPY config /home/torquebox/oadr/config/
  9. COPY db /home/torquebox/oadr/db/
  10. COPY lib /home/torquebox/oadr/lib/
  11. COPY public /home/torquebox/oadr/public/
  12. COPY spec /home/torquebox/oadr/spec/
  13. COPY test /home/torquebox/oadr/test/
  14. COPY vendor /home/torquebox/oadr/vendor/
  15. COPY config.ru Gemfile Gemfile.lock Rakefile /home/torquebox/oadr/
  16. RUN sed -i "s|https://rubygems.org|http://rubygems.org|" /home/torquebox/oadr/Gemfile
  17. RUN chown -R torquebox:torquebox /opt/torquebox /home/torquebox && ln -s /opt/torquebox/torquebox-3.0.2 /opt/torquebox/current
  18. USER torquebox
  19. WORKDIR /home/torquebox/oadr
  20. ENV TORQUEBOX_HOME=/opt/torquebox/current
  21. ENV JBOSS_HOME=${TORQUEBOX_HOME}/jboss JRUBY_HOME=${TORQUEBOX_HOME}/jruby
  22. ENV PATH=${JBOSS_HOME}/bin:${JRUBY_HOME}/bin:$PATH
  23. ENV RAILS_ENV=production
  24. RUN bundle install
  25. RUN rake assets:precompile
  26. COPY docker-entrypoint.sh docker-run.sh docker-initdb.sh /
  27. ENTRYPOINT ["/docker-entrypoint.sh"]
  28. CMD ["run"]