Skip to content

WilHall/wilhall.com

Repository files navigation

Overview

Hyperlocal art and events

Local Development

On Ubuntu

  1. git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
  2. echo ". $HOME/.asdf/asdf.sh" >> ~/.bashrc
  3. source ~/.bashrc
  4. sudo apt-get install libpq-dev
  5. asdf plugin add nodejs
  6. asdf plugin add ruby
  7. asdf plugin add yarn
  8. asdf install
  9. rails db:create db:migrate
  10. bin/dev

Hosting Setup

Ubuntu 24.04 install dependencies as root

  1. sudo apt-get install locate postgresql nginx build-essential checkinstall libvips zlib1g-dev libssl-dev libffi-dev libtool libyaml-dev libcurl4-openssl-dev libpq-dev dirmngr gnupg npm dirmngr gnupg apt-transport-https ca-certificates curl gnupg apt-transport-https redis-server
  2. Follow https://www.phusionpassenger.com/docs/advanced_guides/install_and_upgrade/nginx/install/oss/noble.html
  3. Follow https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-22-04
  4. sudo apt-get remove nodejs libnode-dev
  5. curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
  6. sudo apt-get install -y nodejs
  7. npm install --global yarn
  8. curl -sSL https://get.rvm.io | bash -s stable --ruby
  9. echo 'source /usr/local/rvm/scripts/rvm' >> ~/.bashrc
  10. exec bash
  11. rvm install "ruby-3.3.4"
  12. sudo snap install --classic certbot
  13. sudo ln -s /snap/bin/certbot /usr/bin/certbot
  14. sudo certbot --nginx
  15. sudo -u postgres -s
  16. psql
  17. CREATE DATABASE wilhall_production
  18. CREATE USER wilhall PASSWORD '...';
  19. GRANT ALL PRIVILEGES ON DATABASE wilhall_production TO wilhall;
  20. exit
  21. exit
  22. cp sidekiq.service /etc/systemd/system
  23. sudo systemctl daemon-reload
  24. sudo systemctl enable sidekiq
  25. sudo systemctl start sidekiq
server {
   listen 80;
   server_name wilhall.com;
   passenger_enabled on;
   passenger_app_env production;
   passenger_app_root /var/www/wilhall.com;
   root /var/www/wilhall.com/public;
}

For debugging: sudo less /var/log/nginx/error.log

Deployment

  1. git pull
  2. bin/deploy