Giter VIP home page Giter VIP logo

mentoring's Introduction

mentoring

Installation and running

Please run locally bundle install mailcatcher https://github.com/sj26/mailcatcher: Please don't put mailcatcher into your Gemfile. It will conflict with your applications gems at some point.

Configure server: Change ip in config/provision/production if needed local - ansible-playbook --inventory=config/provision/production config/provision/provision.yml Don't forget to add it to gmail.com white list

remote - ssh root@server_ip nano ../home/mentoring/apps/mentoring_production/shared/config/environment.production Fill it with correct variables - see in TODO.txt

Deploy the app: local - don't forget to comment/uncomment last 2 lines in config/deploy.rb bundle exec cap production deploy --trace

Restore db from backup local - scp ../backups/mentoring/08.04.2018/4b943051-616c-444b-b3be-5fbf61edcfdd [email protected]:/home/mentoring/apps/mentoring_production

remote - cd ../home/mentoring/apps/mentoring_production/ sudo su postgres pg_restore -d mentoring_production 4b943051-616c-444b-b3be-5fbf61edcfdd

Get logs remote - cd ../home/mentoring/apps/mentoring_production/current/log tail -f production.log

Rails console ssh [email protected] ~/apps/mentoring_production/current$ bundle exec rails console production

Installation with Docker

If you prefer Docker, it is possible to deploy an app into docker environment. You will need to copy docker-compose.yml and all bash scripts from script folder into you production server and additionally you will need to create secrets with environment variables. You will need to check docker-compose.yml section secrets: at the bottom of file and generate all these secrets. They could be placed in secrets folder. So you should gain a such structure:

docker-compose.yml
scripts/
secrets/

Production environment variables

  • HTTP_HOST - your domain, i.e. nastavnik54.ru

Databases variables

  • DB_HOST - database host
  • DB_NAME - database name
  • DB_USERNAME - database user role
  • DB_USERPASS - database user password
  • REDIS_HOST

Mailer configuration

There are two options: you can use postfix or gmail smtp. First will be provided via one more installed container and it goes by default. To use gmail you'll need to set GMAIL_USER variable in compose file.

Keep in mind that gmail smtp has some restrictions

  • GMAIL_USER (optional)
  • GMAIL_PASS (optional)
  • MAILER_SENDER - This is a string which represents outgoing mails sender field, ie "Программа Детский дом" <[email protected]>. You need to change to whatever you need

Cookies token

  • SECRET_KEY_BASE - key that used for verifying the integrity of signed cookies. Can be generated via bin/rake secret

mentoring's People

Contributors

gsuvorov avatar max-konin avatar newsiberian avatar shabalinsky avatar unnumbered avatar vasiliqa avatar vasilisca avatar

Watchers

 avatar  avatar  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.