Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.
/ deploy_with_unicorn Public archive

๐Ÿš€ Deploy rails application with unicorn

Notifications You must be signed in to change notification settings

mrjosh/deploy_with_unicorn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Requirement

  • Unicorn
    • You can install with gem install 'unicorn'
  • Rails application

Usage

Download deployer file

curl -LsS https://git.io/vAgP6 -o ./deploy.rb

Use the command like this

$ ruby deploy.rb --help

Arguments:

Add your custom arguments in command line

Argument Type of Parameter Description
--pid-file string Application pid path
--errors-file string Server errors file path
--output-file string Server output file path
--socket-file string The class of item
--workers integer Number of workers
--timeout integer Number of timeout
--env string Rails application environment - default: development

Deploy

Deploy your rails application with unicorn to create socket file

$ ruby deploy.rb [arguments] --start

Config rails application on nginx

Define upstream app in nginx config file

upstream app {
	
	server unix:/File/path/to/unicorn/socket/file.sock fail_timeout=0;

}

Define server

server {
	
	listen 3000 default;

	root /File/path/to/rails/project/public;

	try_files $uri/index.html $uri @app;

	location @app {

		proxy_pass http://app;
	}
}

And then restart you nginx server and enjoy your application on rails with unicorn and nginx.

About

๐Ÿš€ Deploy rails application with unicorn

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages