notebookCarnet de notes

  • A propos
  • Accueil
  • Anti-sèche
  • Notes
  • DOCKER

    d'abord éditer localement app_config.yml et l'envoyer sur le serveur

            scp app_config.yml root@host.net:/var/www
    

    puis lancer les containers propres à foodsoft

            docker pull foodcoops/foodsoft:4.6.0
    
            docker run --name foodsoft_web -p 3000 -e SECRET_KEY_BASE='mYunBreAkaBleKEY15476147654145' -e DATABASE_URL='mysql2://root:mysql@172.17.0.2/foodsoftdb?encoding=utf8' -e REDIS_URL='redis://172.17.0.4:6379' -e RAILS_FORCE_SSL=false   -v /var/www/app_config.yml:/usr/src/app/config/app_config.yml:ro   foodcoops/foodsoft:4.6.0
    
            docker run --name foodsoft_setup --rm  -e SECRET_KEY_BASE='mYunBreAkaBleKEY15476147654145' -e DATABASE_URL='mysql2://root:mysql@172.17.0.2/foodsoftdb?encoding=utf8' -e REDIS_URL='redis://172.20.0.4:6379' -v /var/www/app_config.yml:/usr/src/app/config/app_config.yml:ro   foodcoops/foodsoft:4.6.0 bundle exec rake db:setup
    
            docker run --name foodsoft_worker  -e SECRET_KEY_BASE='mYunBreAkaBleKEY15476147654145' -e DATABASE_URL='mysql2://root:mysql@172.17.0.2/foodsoftdb?encoding=utf8' -e REDIS_URL='redis://172.17.0.4:6379' -v /var/www/app_config.yml:/usr/src/app/config/app_config.yml:ro   foodcoops/foodsoft:4.6.0 ./proc-start worker
    

    Commandes utiles

    Docker-compose

            sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    

    MEMO

    https://github.com/foodcoop-adam/foodsoft/wiki/Deployment-%28Debian%29

    Installer rvm

    $apt-get sintall gpgv2 $curl -L get.rvm.io | bash -s stable

    Ajouter son utilisateur au groupe rvm

    $sudo usermod -a -G rvm toto

    Set the rvm path

    $source $HOME/.rvm/scripts/rvm

    You should add this to the .bashrc file. Fetch the latest rvm and reload it

    $echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc $rvm get head && rvm reload

    Installer ruby avec rvm

    $rvm list known $rvm install ruby-2.4.2

    Get the rails gem

    $gem install rails

    Check if you have rails

    $rails -v Rails 5.2.1