This is a simple image for hosting your own 5eTools instance. It is based on the Apache `httpd` image and uses components of the auto-updater script from the [5eTools wiki](https://wiki.tercept.net/en/5eTools/InstallGuide). This image is built from [this GitHub repository](https://github.com/Jafner/5etools-docker).
When you stop the container, it will automatically delete itself. The downloaded files will remain in the `~/5etools-docker/htdocs` directory, so you can always start the container back up by running `docker-compose up -d`.
By default, I assume you want to keep downloaded files, even if the container dies. And you want the downloaded files to be located at `~/5etools-docker/htdocs`.
If you want the files to be located somewhere else on your system, change the left side of the volume mapping. For example, if I wanted to keep my files at `~/data/docker/5etools`, the volume mapping would be:
Alternatively, you can have Docker or Compose manage your volume. (This makes adding homebrew practically impossible.)
Use a Compose-managed volume with:
```
...
volumes:
- 5etools-docker:/usr/local/apache2/htdocs
...
volumes:
5etools-docker:
```
Or have the Docker engine manage the volume (as opposed to Compose). First, create the volume with `docker volume create 5etools-docker`, then add the following to your `docker-compose.yml`:
```
...
volumes:
- 5etools-docker:/usr/local/apache2/htdocs
...
volumes:
5etools-docker:
external: true
```
## Environment Variables
The image uses environment variables to figure out how you want it to run.
By default, I assume you want to automatically download the latest files from the Github mirror. Use the environment variables in the `docker-compose.yml` file to configure things.
> "TRUE" pulls from https://github.com/5etools-mirror-2/5etools-mirror-2.github.io.git and adds https://github.com/5etools-mirror-2/5etools-img as a submodule for image files.
> "FALSE" pulls from https://github.com/5etools-mirror-2/5etools-mirror-2.github.io.git without image files.
During the image build process, we set the owner of the `htdocs` directory to `1000:1000` by default. If you need a different UID and GID to own the files, you can build the image from the source Dockerfile and pass the PUID and PGID variables as desired.
2. Assuming you are using the mapping `~/5etools-docker/htdocs:/usr/local/apache2/htdocs` place your homebrew json files into the `~/5etools-docker/htdocs/homebrew/` folder, then add their filenames to the `~/5etools-docker/htdocs/homebrew/index.json` file.
"NOTE: This feature is designed for use in user-hosted copies of the site, and not for integrating \"official\" 5etools content.",
"The \"production\" version of the site (i.e., not the development ZIP) has this feature disabled. You can re-enable it by replacing `IS_DEPLOYED = \"X.Y.Z\";` in the file `js/utils.js`, with `IS_DEPLOYED = undefined;`",
"This file contains as an index for other homebrew files, which should be placed in the same directory.",
"For example, add \"My Homebrew.json\" to the \"toImport\" array below, and have a valid JSON homebrew file in this (\"homebrew/\") directory."