# Multiple container setup problems

**URL:** https://meta.discourse.org/t/multiple-container-setup-problems/140680
**Category:** Self-hosting
**Created:** [February 5, 2020, 5:57am UTC](https://meta.discourse.org/t/multiple-container-setup-problems/140680 "2020-02-05T05:57:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Silvanus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/silvanus/32/62831_2.png) [@Silvanus](https://meta.discourse.org/u/Silvanus)
#### Post date: [February 5, 2020, 5:57am UTC](https://meta.discourse.org/t/multiple-container-setup-problems/140680/1 "2020-02-05T05:57:24Z")

</div>

Hi all! After trying to figure out multisite setup but failing miserably, I ended up doing three separate containers, one for my current forum and two for the archive forums. I went with socketed, [managed to get NGINX working](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247) and [I even have Let’s Encrypt per these guidelines](https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx).

I gave the archive forums one unicorn, the current only one, but I’m running into a thought: can I really be doing this out of the box like this? Are all containers running redis & sidekiq in a way that messes it up royally? Or should I somehow link the two archive containers to the first one and so on? Because now after restore I’m getting this message:

> Oops  
> The software powering this discussion forum encountered an unexpected problem. We apologize for the inconvenience.
> 
> Detailed information about the error was logged, and an automatic notification generated. We’ll take a look at it.
> 
> No further action is necessary. However, if the error condition persists, you can provide additional detail, including steps to reproduce the error, by posting a discussion topic in the site’s feedback category.

I understood from the [multisite topic](https://meta.discourse.org/t/multisite-configuration-with-docker/14084) that there should be two separate containers when doing multisite, but I never quite understood what is meant by data and web containers. Does this mean that data containers is the only one using sql and web redies & sidekiq or what?

I’m a quick learner and a bit learned when it comes to this stuff, but can’t really say I’m a sysadmin.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 5, 2020, 1:47pm UTC](https://meta.discourse.org/t/multiple-container-setup-problems/140680/2 "2020-02-05T13:47:03Z")

</div>

The recommendation is that you have one container with redis and Postgres and a second with the web server. If you have two web containers then you’ll need to have another external nginx reverse proxying to the web containers. It’ll be easier to have a single multisite server.

---

<div class="post-metadata">

### Author: ![Silvanus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/silvanus/32/62831_2.png) [@Silvanus](https://meta.discourse.org/u/Silvanus)
#### Post date: [February 5, 2020, 1:55pm UTC](https://meta.discourse.org/t/multiple-container-setup-problems/140680/3 "2020-02-05T13:55:37Z")

</div>

I have this in `/etc/nginx/sites-available/default`:

```
server {

        server_name www.uskojarukous.fi uskojarukous.fi nyforum.uskojarukous.fi;

        location /errorpages/ {
                alias /var/www/errorpages/;
        }

        location / {
                proxy_pass http://unix:/var/discourse/shared/nyforum/nginx.http.sock:;
                proxy_set_header Host $http_host;
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header X-Real-IP $remote_addr;
                error_page 502 =502 /errorpages/offline.html;
        }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/uskojarukous.fi/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/uskojarukous.fi/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {

        server_name urforum.uskojarukous.fi;

        location /errorpages/ {
                alias /var/www/errorpages/;
        }

        location / {
                proxy_pass http://unix:/var/discourse/shared/urforum/nginx.http.sock:;
                proxy_set_header Host $http_host;
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header X-Real-IP $remote_addr;
                error_page 502 =502 /errorpages/offline.html;
        }

    listen [::]:443 ssl; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/uskojarukous.fi/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/uskojarukous.fi/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {

        server_name ueforum.uskojarukous.fi;

        location /errorpages/ {
                alias /var/www/errorpages/;
        }

        location / {
                proxy_pass http://unix:/var/discourse/shared/ueforum/nginx.http.sock:;
                proxy_set_header Host $http_host;
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header X-Real-IP $remote_addr;
                error_page 502 =502 /errorpages/offline.html;
        }

    listen [::]:443 ssl; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/uskojarukous.fi/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/uskojarukous.fi/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
    if ($host = www.uskojarukous.fi) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    if ($host = nyforum.uskojarukous.fi) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    if ($host = uskojarukous.fi) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

        listen 80;
        listen [::]:80;

        server_name www.uskojarukous.fi uskojarukous.fi nyforum.uskojarukous.fi;
    return 404; # managed by Certbot

}

server {
    if ($host = ueforum.uskojarukous.fi) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

        listen 80;
        listen [::]:80;

        server_name ueforum.uskojarukous.fi;
    return 404; # managed by Certbot

}

server {
    if ($host = urforum.uskojarukous.fi) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

        listen 80;
        listen [::]:80;

        server_name urforum.uskojarukous.fi;
    return 404; # managed by Certbot

}

```

At least two of the forums work all right…
