This guide provides instructions for deploying your PropertyWebBuilder application to Alwaysdata.
- An Alwaysdata account.
- Your application code pushed to a Git repository (e.g., GitHub).
- SSH access to your Alwaysdata account.
- Log in to your Alwaysdata administration panel.
- Navigate to Web > Sites.
- Click Add a Site.
- Choose Ruby Rack as the type.
- Set the Application Path to the directory where your application's
config.rufile will be located (e.g.,/home/your-account/www/pwb). - Under the Configuration section, check the Use Bundler option.
- Define your application's Environment (e.g.,
production). - Save the site configuration.
- Connect to your Alwaysdata account via SSH.
- Navigate to the directory you specified as the application path (e.g.,
cd ~/www/pwb). - Clone your application's repository into this directory:
git clone https://github.com/your-username/propertywebbuilder.git . - Install the dependencies using Bundler:
bundle install
- In the Alwaysdata admin panel, navigate to Databases > PostgreSQL.
- Create a new PostgreSQL database and a user for your application.
- Note the database name, username, password, and host.
- Go back to the Web > Sites section and select your application.
- Under the Environment Variables section, add a new variable
DATABASE_URLwith the following format:postgresql://USER:PASSWORD@HOST/DATABASE_NAME - Also, add your
RAILS_MASTER_KEYas another environment variable.
- Connect to your Alwaysdata account via SSH.
- Navigate to your application directory.
- Run the Rails database migrations:
RAILS_ENV=production bundle exec rails db:migrate
- In the Alwaysdata panel, go to Web > Sites and restart your application for the changes to take effect.
- Your application should now be live at the address provided by Alwaysdata.