I managed to migrate to two containers. If anyone else needs instructions, this is how it worked for me.
stop current standalone container
./launcher stop app
copy web_only.yml
and data.yml
from samples/
to containers/
rename them to whatever you’d like
if you rename them, please pay attention to the entries volumes:
in data.yml
and web_only.yml
If you renamed web_only.yml
to web_rocks.yml
you need to modify the entry like this:
volumes:
- volume:
host: /var/discourse/shared/web_rocks
guest: /shared
- volume:
host: /var/discourse/shared/web_rocks/log/var-log
guest: /var/log
Do this in data.yml
and web_only.yml
accordingly.
- Start with
data.yml
and set a password for the database.
- run
./launcher bootstrap data
(or whatever you renamed data to)
- if everything goes smoothly you need to connect to the container via ssh and get the IP address:
./launcher ssh data
(again: replace data with your name)
- after connecting successfully type
ifconfig
- The results might look like this:
eth0 Link encap:Ethernet HWaddr 02:42:ac:11:01:3a
inet addr:172.17.1.58 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:acff:fe11:13a/64 Scope:Link
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:11657 errors:0 dropped:0 overruns:0 frame:0
TX packets:9846 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3617250 (3.6 MB) TX bytes:3842216 (3.8 MB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1307 errors:0 dropped:0 overruns:0 frame:0
TX packets:1307 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:634713 (634.7 KB) TX bytes:634713 (634.7 KB)
The important part is right up there in the eth0
block. find inet addr:172.17.1.58
and take note of the ip address that’s shown. Write it down.
Modify web_only.yml
Somewhere in there you’ll find this block:
DISCOURSE_DB_USERNAME: discourse
DISCOURSE_DB_PASSWORD: mypassword
DISCOURSE_DB_HOST: 172.17.1.58
DISCOURSE_REDIS_HOST: 172.17.1.58
- Enter the password you set inside the data container.
- Enter the IP address you just wrote down. For
DB_HOST
and for REDIS_HOST
.
- You probably didn’t change the
DB_USERNAME
.
You’ll find the values for DISCOURSE_DEVELOPER_EMAILS
and DISCOURSE_HOSTNAME
and many more. You already have these values in your app.yml
. Copy them from there.
- Link your data container to your web container:
Find these lines (they are commented)
links:
- link:
name: data_new_name
alias: data
If you renamed the data.yml to ‘something_else’ put it in for ‘name’. I renamed my data.yml to data_new_name.yml for this example. Make sure you remove the comments from the lines.
In the hooks section remember to set any additional plugins you already use inside app.yml
Now you should be ready to bootstrap it:
./launcher bootstrap web_only
(again with your name)
After this, everything worked again for me and my discourse installation was running again, but now in two separate containers.