When browsing to sites after setting up multisite, returning 502 Bad Gateway


(Shayden Martin) #1

I recently setup another of our forums on Discourse using this tutorial:

We have separated the app and data container. I’ll post the web yaml file at the bottom of this post.

After bootstrapping the new containers, and starting both, browsing to our forum server returns a 502 Bad Gateway for both domains.

web.yml:

templates:
  - "templates/sshd.template.yml"
  - "templates/web.template.yml"

expose:
  - "80:80"
  - "2222:22"

params:
  ## Which Git revision should this container use? (default: tests-passed)
  #version: tests-passed

env:
  LANG: en_US.UTF-8

  UNICORN_WORKERS: 3

  DISCOURSE_DB_SOCKET: '5432'
  DISCOURSE_DB_USER: discourse
  DISCOURSE_DB_PASSWORD: ####
  DISCOURSE_DB_HOST: ####
  DISCOURSE_REDIS_HOST: ####

  DISCOURSE_DEVELOPER_EMAILS: ####

  DISCOURSE_HOSTNAME: 'ourdomain'

  DISCOURSE_SMTP_ADDRESS: ####
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: ####
  DISCOURSE_SMTP_PASSWORD: ####

  ## The CDN address for this Discourse instance (configured to pull)
  #DISCOURSE_CDN_URL: //discourse-cdn.example.com

  #CORS Settings, to enable ajax with json endpoints
  DISCOURSE_ENABLE_CORS: true
  DISCOURSE_CORS_ORIGIN: '*'

volumes:
  - volume:
      host: /var/discourse/shared/our_share
      guest: /shared
  - volume:
      host: /var/discourse/shared/our_share/log/var-log
      guest: /var/log

## The docker manager plugin allows you to one-click upgrade Discouse
## http://discourse.example.com/admin/docker
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git
    - exec:
        cd: /var/www/discourse/config
        cmd:
          - echo "oursecondsite:" >> multisite.yml
          - echo "  adapter: postgresql" >> multisite.yml
          - echo "  database: b_discourse" >> multisite.yml
          - echo "  pool: 25" >> multisite.yml
          - echo "  timeout: 5000" >> multisite.yml
          - echo "  db_id: 2" >> multisite.yml
          - echo "  host_names:" >> multisite.yml
          - echo "    - ourdomain.com" >> multisite.yml

  after_bundle_exec:
    - exec:
        cd: /var/www/discourse
        cmd:
          - sudo -E -u discourse bundle exec rake multisite:migrate

## Remember, this is YAML syntax - you can only have one block with a name
run:
  - exec: echo "Beginning of custom commands"

  ## If you want to configure password login for root, uncomment and change:
  #- exec: apt-get -y install whois # for mkpasswd
  ## Use only one of the following lines:
  #- exec: /usr/sbin/usermod -p 'PASSWORD_HASH' root
  #- exec: /usr/sbin/usermod -p "$(mkpasswd -m sha-256 'RAW_PASSWORD')" root

  ## If you want to authorized additional users, uncomment and change:
  #- exec: ssh-import-id username
  #- exec: ssh-import-id anotherusername

  - exec: echo "End of custom commands"
  - exec: awk -F\# '{print $1;}' ~/.ssh/authorized_keys | awk 'BEGIN { print "Authorized SSH keys for this container:"; } NF>=2 {print $NF;}'

(Rodrigo Farcas) #2

Anybody has clues/hints on this one?


(Rodrigo Farcas) #3

I really need help with this. Anything we could try meanwhile, or additional info requested in order to troubleshoot?

Thanks!!