Note: I forgot a detail. Before perform ./discourse-setup, you need edit discourse-setup.
Open discourse-setup with text editor, search for check_ports() { and change this:
check_port "80"
check_port "443"
To something like this:
check_port "8060"
check_port "9443"
Done.
After the fist installation, you get an error because 80 and 443 ports are in use by Plesk
Don’t worry!
Go to /containers/ and open app.yml with text editor (nano or wathever)
Find this lines:
“80:80” # fwd host port 80 to container port 80 (http)
“443:443” # fwd host port 443 to container port 443 (https)
Change to something like this:
“8060:80” # fwd host port 80 to container port 8060 (http)
“9443:443” # fwd host port 443 to container port 9443 (https)
Save and perform ./launcher rebuild app
Now, go back to Plesk panel, enter on your domain and find Docker Proxy Rules
Congrats and thank you for this tutorial. I have problems with installation…
Just yerterday I installed a new website version, but now with discourse community discussion software: https://ashesofcreation.es (in development)
comunidad.ashesofcreation.es (discourse)
I can’t install Let’s Encrypt certificate to subdomain (discourse app are inside)
People often have trouble with Centos and docker, but if it’s already installed, perhaps it’s properly configured. If that’s the case, the install instructions should work just fine. Try it and see.
Thanks for the article… I’m quite new to Discourse.
I tried installing it on my Debian Plesk system.
At first all seemed working fine… I did all as it is described above. But I had problems with discourse sending mails. So I changed the smtp settings (used mailgun) in app.yml and used ./launcher rebuild app
Afterwards discourse was not accessible via browser anymore…
I also tried to remove the container in plesk and running setup again but id didn’t help. I probably screwd up the installation even more…
templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
- "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
#- "templates/web.ssl.template.yml"
#- "templates/web.letsencrypt.ssl.template.yml"
## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
expose:
- "8060:80" # http
- "9443:443" # https
params:
db_default_text_search_config: "pg_catalog.english"
## Set db_shared_buffers to a max of 25% of the total memory.
## will be set automatically by bootstrap based on detected RAM, or you can override
db_shared_buffers: "4096MB"
## can improve sorting performance, but adds memory usage per-connection
#db_work_mem: "40MB"
## Which Git revision should this container use? (default: tests-passed)
#version: tests-passed
env:
LANG: en_US.UTF-8
# DISCOURSE_DEFAULT_LOCALE: en
## How many concurrent web requests are supported? Depends on memory and CPU cores.
## will be set automatically by bootstrap based on detected CPUs, or you can override
UNICORN_WORKERS: 8
## TODO: The domain name this Discourse instance will respond to
DISCOURSE_HOSTNAME: XXXXX
## Uncomment if you want the container to be started with the same
## hostname (-h option) as specified above (default "$hostname-$config")
#DOCKER_USE_HOSTNAME: true
## TODO: List of comma delimited emails that will be made admin and developer
## on initial signup example 'user1@example.com,user2@example.com'
DISCOURSE_DEVELOPER_EMAILS: 'XXXXX'
## TODO: The SMTP mail server used to validate new accounts and send notifications
DISCOURSE_SMTP_ADDRESS: smtp.mailgun.org
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: XXXXX
DISCOURSE_SMTP_PASSWORD: "XXXXX"
#DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)
## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
#LETSENCRYPT_ACCOUNT_EMAIL: me@example.com
## The CDN address for this Discourse instance (configured to pull)
## see https://meta.discourse.org/t/14857 for details
#DISCOURSE_CDN_URL: //discourse-cdn.example.com
## The Docker container is stateless; all data is stored in /shared
volumes:
- volume:
host: /var/discourse/shared/standalone
guest: /shared
- volume:
host: /var/discourse/shared/standalone/log/var-log
guest: /var/log
## Plugins go here
## see https://meta.discourse.org/t/19157 for details
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- git clone https://github.com/discourse/docker_manager.git
## Any custom commands to run after building
run:
- exec: echo "Beginning of custom commands"
## If you want to set the 'From' email address for your first registration, uncomment and change:
## After getting the first signup email, re-comment the line. It only needs to run once.
#- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
- exec: echo "End of custom commands"
I tried again, removed the discourse folder and started from the beginning…
Now I can’teven get it to run at all (maybe deleting the folder wasn’t such a good idea ):
2017-11-01 21:25:14.996 UTC [47] LOG: database system shutdown was interrupted; last known up at 2017-11-01 21:19:10 UTC
2017-11-01 21:25:15.604 UTC [47] LOG: database system was not properly shut down; automatic recovery in progress
2017-11-01 21:25:15.655 UTC [47] LOG: redo starts at 0/170E300
2017-11-01 21:25:19.266 UTC [47] LOG: invalid record length at 0/25C6630
2017-11-01 21:25:19.266 UTC [47] LOG: redo done at 0/25C6608
2017-11-01 21:25:19.266 UTC [47] LOG: last completed transaction was at log time 2017-11-01 21:11:57.661238+00
I, [2017-11-01T21:25:19.509808 #15] INFO -- :
I, [2017-11-01T21:25:19.510076 #15] INFO -- : > su postgres -c 'createdb discourse' || true
2017-11-01 21:25:19.578 UTC [51] postgres@postgres FATAL: the database system is starting up
2017-11-01 21:25:19.580 UTC [52] postgres@template1 FATAL: the database system is starting up
createdb: could not connect to database template1: FATAL: the database system is starting up
I, [2017-11-01T21:25:19.581747 #15] INFO -- :
I, [2017-11-01T21:25:19.582022 #15] INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2017-11-01 21:25:19.647 UTC [63] postgres@discourse FATAL: the database system is starting up
psql: FATAL: the database system is starting up
I, [2017-11-01T21:25:19.649514 #15] INFO -- :
I, [2017-11-01T21:25:19.649722 #15] INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
2017-11-01 21:25:19.705 UTC [74] postgres@discourse FATAL: the database system is starting up
psql: FATAL: the database system is starting up
I, [2017-11-01T21:25:19.707270 #15] INFO -- :
I, [2017-11-01T21:25:19.707449 #15] INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
2017-11-01 21:25:19.754 UTC [85] postgres@discourse FATAL: the database system is starting up
psql: FATAL: the database system is starting up
I, [2017-11-01T21:25:19.755549 #15] INFO -- :
I, [2017-11-01T21:25:19.755797 #15] INFO -- : Terminating async processes
I, [2017-11-01T21:25:19.755835 #15] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.5/bin/postmaster -D /etc/postgresql/9.5/main pid: 44
2017-11-01 21:25:19.755 UTC [44] LOG: received fast shutdown request
I, [2017-11-01T21:25:29.756377 #15] INFO -- : HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.5/bin/postmaster -D /etc/postgresql/9.5/main pid:44 did not terminate cleanly, forcing termination!
FAILED
--------------------
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return #<Process::Status: pid 75 exit 2>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params "su postgres -c 'psql $db_name -c \"alter schema public owner to $db_user;\"'"
3bf8e9a04c7bf43219bb1b7ae3bb1c733345ba6074ea1068a070422e2d10fb5e
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one
How can I correctely delete discourse completeley, so I can start all over?