These are docker images that allow you to deploy an instance of E621 with... relative ease.
- Have docker installed.
- Copy
env.example
to.env
. Optionally, change NGINX_PORT if you want to run the service on a different port. - Copy
core/danbooru_local_config.example.rb
tocore/danbooru_local_config.rb
. This file can be used to override any setting in here. Make sure to check below for the values you can't change (docker overrides a couple in order to make E621 talk to the network's redis, memcached and elasticsearch containers). - Create your data folders. If you're using the default configuration, this will be in the
data
folder locally. Make sure that the elasticsearch scratch space (in default configuration, this is./data/es
) has been set to be read/write for everywhere. - Set
vm.overcommit_memory=1
andvm.max_map_count=262144
in/etc/sysctl.conf
to make redis and elasticsearch work. (If you have a/etc/sysctl.d
folder, make a new file calleddocker.conf
and add them in there). To temporarily raise it for the current session, runsysctl -w vm.max_map_count=262144
andsysctl -w vm.overcommit_memory=1
as root. - Run
docker-compose pull
to pull in the containers. - Run
docker-compose up
to bring up the images. On the first run, the database will be initialized, which takes a few minutes. - Reference the HACKS file to see if you need to apply any hacks.
- After applying hacks, restart all containers with
docker-compose restart
. - Success
- Run
docker-compose pull
to update the containers. - Reference the HACKS file to see if you need to undo or apply any hacks.
- Run
docker-compose run --rm core rake db:migrate
to run the database migrations. - Run
docker-compose up
to bring up the images again.
- The first user you create will automatically be given administrator privileges.
- SSL disable patch: Disables the forced SSL that E621 normally has.
- Uploader accepts 0 tags: This changes the JS uploader to not demand tags to be placed on an image.
- Patch to artist forms to remove linked users from artists (it relies on missing table fields).
- Session patch: Disables SameSite cookies, which are causing issues in SessionLoader.
- User presenter patch: Fixes favorite sorting relying on a non-existing database column, causing errors in showing profiles if users tried to favorite something.
The following change is not a git diff file, but happens in the docker building process:
sed
incore/cable.yml
: An inline patch to make E621 talk to the redis container server.
The following values should not be overriden by the local_config file.
elasticsearch_host
ssl_options
memcached_servers
redis_url
- When updating the checked out e621 code, do a quick test build of the core. A mere
docker-compose build core --pull
should help identify any errors that might pop up. - Nokogumbo fails to build when installed using bundler for some reason. Manually installing it using
gem
works, but it's a workaround. Whensanitize
(the gem that wants nokogumbo) is updated, check to make sure that the build still works and optionally remove the workaround. - Users will be able to pull in the repo by just pulling, you'll want to build locally to test if stuff works.
- The lovely people from StackOverflow, ElasticSearch community forums and various Ruby on Rails support communities for providing the resources.
- The various developers of E621s source code.
- A dishonorable credit to the developers of Danbooru for using Ruby on Rails and having broken migrations rot in the codebase.
- An exceptionally dishonorable credit to the developers of Ruby on Rails for making an awful bloated mess of a library that is terrible to troubleshoot.
Pull Requests for these are welcome.
- Build script that takes care of creating data folder in the right way and sets up the env file.