Posts

Showing posts from May, 2022

#8. nginx+puma deployment using capistrano

 In the Gemfile, ---------------------------------------- group :development do   gem 'capistrano',         require: false   gem 'capistrano-rvm',     require: false   gem 'capistrano-rails',   require: false   gem 'capistrano-bundler', require: false   gem 'capistrano3-puma',   require: false end -------------------------------------------------- bundle install cap install create a file as,  /home/raj/workspace/chat/config/nginx.conf ------------------------------------------------ upstream puma {   server unix:///home/raj/deployed_apps/chat/shared/tmp/sockets/chat-puma.sock; } server {   listen 80 default_server deferred;   # server_name example.com;   root /home/raj/deployed_apps/chat/current/public;   access_log /home/raj/deployed_apps/chat/current/log/nginx.access.log;   error_log /home/raj/deployed_apps/chat/current/log/nginx.error.log info;   location ...

#11. Run rails app in production mode

Check in produciton.rb, it should be false, config.assets.compile = false  precompile the assets, RAILS_ENV=production bundle exec rake assets:precompile It should be set in the env file as true config.public_file_server.enabled = true Then run server as, rails s -e production or RAILS_ENV=production rails s

#13. docker helpful commands

Restarting docker -   service docker restart docker images -a docker rmi Image Image