Git Product home page Git Product logo

from-scratch's Introduction

FromScratch

I'm sick and tired of thousands of articles "How to setup Rails app server". Here is your last command to do that.

No configs, no questions. Just one ring to rule them all one command to get fully functional server with best security practices ready for first cap production deploy.

Usage

$ gem install from-scratch
$ scratchify your_app_name your.host.com

And everything is done. Then add following to your config/deploy.rb or config/deploy/production.rb for Capistrano:

server 'your.host.com', user: 'deploy', roles: %w(app db web)
set :deploy_to, "/home/deploy/your_app_name"

Supports

OS:

  • APT-based Linux (Ubuntu, Debian)
  • YUM-based Linux (RedHat, CentOS)

It's a kind of magic!

Not actully. Just preconfigured Chef. Here are the things done with the command:

  • Install user-wide RVM with latest MRI (2.2.3)
  • Install PostgreSQL, create database with user, pg_tune a little
  • Add deploy non-admin user to system specially for your app, upload your SSH pub key to it
  • Install nginx and replace it's default site config with one prepared for rails app
  • Generate app folder inside deploy's home and generate database.yml and secrets.yml

Things you need to know

Nginx config is set up to connect to unix socket placed at /home/deploy/your_app_name/shared/tmp/sockets/application.sock. Change it manually or config your favorite app server (Puma, Unicorn, Thin etc) to place it's socket there.

You can just ssh [email protected] because your SSH pub key is already there.

Both postgres and your_app_name DB users get (different) randomly generated passwords. You can see app-user password inside config/database.yml, but postgres password is not saved anywhere. If you need admin access to your PostgreSQL, then you should SSH as root and:

# su - postgres
$ psql

Development

Feel free to create bug-reports and feature-requests here on Issues page

Contributing

All help is highly appreciated. I'll be thankful for recipes fixes and advices as well as new features implementations. Just fork and pull-request when you have some proposals.

License

The gem is available as open source under the terms of the MIT License.

from-scratch's People

Watchers

Denis Polulyakh avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.