Advertisement
Guest User

Docker

a guest
Dec 17th, 2015
417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. FROM phusion/passenger-customizable
  2. MAINTAINER VodkaMD <support@nyvur.com>
  3.  
  4. ENV RACK_ENV="production" RAILS_ENV="production" SECRET_KEY_BASE="e09afa8b753cb175bcef7eb5f737accd02a4c16d9b6e5d475943605abd4277cdf47c488812d21d9c7117efd489d876f34be52f7ef7e88b21759a079339b198ce"
  5.  
  6. ENV HOME /root
  7. CMD ["/sbin/my_init"]
  8.  
  9. RUN /pd_build/utilities.sh
  10. RUN /pd_build/ruby2.2.sh
  11. RUN /pd_build/python.sh
  12. RUN /pd_build/nodejs.sh
  13.  
  14. # Custom instructions
  15. RUN apt-get update && apt-get install -y vim nano dialog net-tools build-essential wget
  16. RUN apt-get install -y postgresql-client --no-install-recommends
  17. RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  18.  
  19. # Generate SSL Certificate
  20. RUN mkdir /etc/nginx/ssl
  21. # RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt
  22.  
  23. # Enable Nginx and Passenger
  24. RUN rm -f /etc/service/nginx/down
  25. # Enable Redis
  26. RUN rm -f /etc/service/redis/down
  27. # Enable SSH
  28. RUN rm -f /etc/service/sshd/down
  29. # Enable Postgres
  30. RUN rm -f /etc/service/postgres/down
  31.  
  32. # Install bundle of gems
  33. WORKDIR /tmp
  34. ADD Gemfile /tmp/
  35. ADD Gemfile.lock /tmp/
  36. RUN bundle install
  37.  
  38. # Copy application folder
  39. RUN mkdir /home/app/Nyvur
  40. ADD . /home/app/Nyvur
  41. RUN chown -R app:app /home/app/Nyvur
  42. WORKDIR /home/app/Nyvur
  43. RUN bundle exec rake assets:precompile
  44.  
  45. # Add a virtual host entry
  46. RUN rm /etc/nginx/sites-enabled/default
  47. COPY config/nginx_configs.conf /etc/nginx/sites-enabled/Nyvur.conf
  48. ADD config/postgres-env.conf /etc/nginx/main.d/postgres-env.conf
  49.  
  50. RUN mkdir -p /var/www/Nyvur/tmp/pids
  51. RUN mkdir -p /var/www/Nyvur/tmp/sockets
  52. RUN mkdir -p /var/www/Nyvur/log
  53.  
  54. RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  55.  
  56. EXPOSE 80 443
  57. RUN bundle exec passenger start -p 80 -e production
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement