An unofficial container image for Discourse.
This an alternative (simpler and better) way to run discourse. See the Related section below for a comparison.
Choose one of the 3 supported methods.
This image can be used anywhere OCI containers can be used.
- Prepare dependencies: an OCI container runtime, PostgreSQL, Redis
- Optional: Nginx
- Create a
discourse.conf
with your hostname, redis and db details. - Start the container.
- You should map /shared to a persistent volume.
- Map port 3000 to host port 80 or point your nginx instance to it.
- In the container, run:
bundle exec rake assets:precompile
bundle exec rake admin:create
- Open the mapped port in your browser.
mkdir -p data/sql
sudo podman play kube pod.yaml
sudo podman exec -it discourse-kiss-app bundle exec rake assets:precompile
sudo podman exec -it discourse-kiss-app bundle exec rake admin:create
open http://localhost:8014/
to update the image:
sudo podman build -t docker.io/0ex0/discourse-kiss .
docker-compose up
docker-compose run app bundle exec rake assets:precompile
docker-compose run app bundle exec rake admin:create
open http://localhost:8014/
The default config is to serve the forum at http://localhost:8014/forum/. This is configurable by:
- edit discourse.conf, relative_url_root
- replace all instances of
/forum/
innginx.conf
with/
- see Upstream docs
misc:
bundle exec script/discourse ...
bundle exec rake --tasks
settings:
bundle exec rake site_settings:export > settings.yml
bundle exec rake site_settings:import < settings.yml
upstream docs:
- https://github.com/discourse/discourse/tree/master/config
- discourse_defaults.conf
- site_settings.yml - defaults, but can be set via UI and saved in DB
- database.yml - does not seem needed
- https://edgeryders.eu/t/discourse-admin-manual/6647
to start a shell in the pod:
podman run -it --pod discourse-kiss alpine
to configure the password:
docker-compose run redis redis-cli -h redis
redis:6379> config set requirepass password123
shell client:
docker-compose exec -u 0 postgresql psql -U postgres
reference
- entrypoint.sh.
- initdb cannot be run as root
webserver
- Unicorn is a Rack HTTP server to serve Ruby web applications
- with podman/compose examples, exposed at http://localhost:8013/forum
Compared to the official method discourse-kiss:
- -a smaller image: XXX vs 1GB- (TODO)
- works with plain any standard OCI runtime, like k8s.
- doesn't require a custom "templating" system
- I tried this image first (Aug 2020), but wasn't satisfied.
- I wasn't about to get a custom discorse.conf working because (1) the "installer" would complain if there was only one config file in the config directory and (2) migrations didn't work with a custom config.
- I sometimes encountered an ERROR ELOOP bug. The Issue was closed even though it wasn't fixed.
- It uses a custom package system called nami and did way too much magic for my liking.
- It took minutes everytime it was started because it recompiled all the static assets of discourse.
- I encountered a few other bugs that didn't increase my confidence in this package.
- uses Passenger, an HTTP proxy and process manager.