nativeInstallerdiscourse

Modify to development mode

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

NOTE: The Approach A sections referred to below do not apply to Bitnami native installers. Users of Bitnami native installers should refer only to the Approach B sections.

Follow these steps:

  • Copy the production database settings to the development section of the config/database.yml file. If you prefer, you can also populate a new database.

  • Stop the Apache server:

      $ sudo installdir/ctlscript.sh stop apache
    
  • Navigate to the Discourse installation directory. Depending on your installation type, run the commands below:

    • Approach A (Bitnami installations using system packages):

        $ cd installdir/discourse
      
    • Approach B (Self-contained Bitnami installations):

        $ cd installdir/apps/discourse/htdocs/
      
  • Checkout the latest Gemfile and Gemfile.lock files and install the required gems:

      $ cd installdir/apps/discourse/htdocs/
      $ git checkout Gemfile*
      $ sudo bundle install --without test sqlite
    
  • Clean assets

      $ ruby bin/rake assets:clean
    
  • Start the server in development mode. Instead of Apache with Passenger you can use the Thin server:

      $ sudo rails server -p 80
    

The Sidekiq server runs in production mode by default. To change this mode, follow these steps depending on your installation type:

  • Approach A (Bitnami installations using system packages): Run the command below to set the mode to development.

      $ echo "export DISCOURSE_ENV=development" | sudo tee -a installdir/scripts/discourse-env.sh
    
  • Approach B (Self-contained Bitnami installations): Change the mode in the Sidekiq script at installdir/apps/discourse/scripts/sidekiq.sh:

      SIDEKIQ_START="installdir/ruby/bin/ruby $DISCOURSE_HOME/bin/sidekiq -P $SIDEKIQ_PIDFILE -e production -L
    
Last modification June 16, 2021