skip to Main Content

Have cloned the Site Inspector repo from Github (https://github.com/siteinspector/siteinspector)

Using Microsoft PowerShell:


git clone https://github.com/siteinspector/siteinspector.git

cd siteinspector

docker-compose up

The redis, postgres and app images are loaded into Docker fine, but when I run the container on localHost (808), the container exits with a code: 1.

"Exit Code 1 means that a container terminated, typically due to an application error or an invalid reference. "

Logs as follows:

siteinspector-app-1 | rake aborted!
siteinspector-app-1 | ArgumentError: Missing secret_key_base for ‘production’ environment, set this string with bin/rails credentials:edit
siteinspector-app-1 | /usr/local/bundle/gems/railties-7.0.3.1/lib/rails/application.rb:581:in validate_secret_key_base' siteinspector-app-1 | /usr/local/bundle/gems/railties-7.0.3.1/lib/rails/application.rb:419:in secret_key_base’
siteinspector-app-1 | /usr/local/bundle/gems/devise-4.8.1/lib/devise/secret_key_finder.rb:24:in key_exists?' siteinspector-app-1 | /usr/local/bundle/gems/devise-4.8.1/lib/devise/secret_key_finder.rb:16:in find’
siteinspector-app-1 | /usr/local/bundle/gems/devise-4.8.1/lib/devise/rails.rb:37:in block in <class:Engine>' siteinspector-app-1 | /usr/local/bundle/gems/railties-7.0.3.1/lib/rails/initializable.rb:32:in instance_exec’
siteinspector-app-1 | /usr/local/bundle/gems/railties-7.0.3.1/lib/rails/initializable.rb:32:in run' siteinspector-app-1 | /usr/local/bundle/gems/railties-7.0.3.1/lib/rails/initializable.rb:61:in block in run_initializers’
siteinspector-app-1 | /usr/local/bundle/gems/railties-7.0.3.1/lib/rails/initializable.rb:60:in run_initializers' siteinspector-app-1 | /usr/local/bundle/gems/railties-7.0.3.1/lib/rails/application.rb:372:in initialize!’
siteinspector-app-1 | /opt/siteinspector/config/environment.rb:7:in <main>' siteinspector-app-1 | /usr/local/bundle/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require’
siteinspector-app-1 | /usr/local/bundle/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' siteinspector-app-1 | /usr/local/bundle/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in require’
siteinspector-app-1 | /usr/local/bundle/gems/railties-7.0.3.1/lib/rails/application.rb:348:in require_environment!' siteinspector-app-1 | /usr/local/bundle/gems/railties-7.0.3.1/lib/rails/application.rb:511:in block in run_tasks_blocks’
siteinspector-app-1 | Tasks: TOP => db:migrate => db:load_config => environment
siteinspector-app-1 | (See full trace by running task with –trace)
siteinspector-app-1 exited with code 1

I expected Site Inspector to open on the localhost port.

2

Answers


  1. Chosen as BEST ANSWER

    Figured it out -- rails secret keys need to be 30+ characters long. Changed in docker-compose.yml and config/secrets.yml files. Removed the old images and containers from docker, then ran docker-compose up again and it worked.


  2. Please assign a value to the SECRET_KEY_BASE variable in the docker-compose.yml file.

    Here is an example:

    SECRET_KEY_BASE: 'inputyourkey' # <-- input a key
    

    app example:

    #docker-compose.yml
    version: '3'
    
    services:
      app:
        depends_on:
          - 'postgres'
          - 'redis'
        image: 'siteinspector/siteinspector:latest'
        ports:
          - '808:808'
        volumes:
          - '.:/app'
        command:  bash -c "rake db:migrate && foreman start"
        environment:
          SECRET_KEY_BASE: 'inputyourkey' # <-- you input a key
          RAILS_LOG_TO_STDOUT: 'true'
          DATABASE_URL: postgresql://postgres:postgres@postgres:5432/siteinspector
          REDIS_URL: redis://redis:6379/0
          PORT: 808
          SIDEKIQ_CONCURRENCY: 10
    
    # ... pass
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search