Expand documentation on building a custom image, provide example

This commit is contained in:
Ariel Rin 2024-01-05 15:42:39 +10:00
parent 51b86f88b9
commit 9f4bf13cc9
No known key found for this signature in database

View File

@ -28,7 +28,7 @@ If at any point `docker compose` does not work, but `docker-compose` does, you h
1. click "Add Proxy Host", with the following settings for auth. The example uses `auth.localhost` for the domain, but you'll want to use whatever address you have auth configured on 1. click "Add Proxy Host", with the following settings for auth. The example uses `auth.localhost` for the domain, but you'll want to use whatever address you have auth configured on
![nginx-host](/_static/images/installation/docker/nginx-host.png) ![nginx-host](/_static/images/installation/docker/nginx-host.png)
1. click "Add Proxy Host", with the following settings for grafana. The example uses `grafana.localhost` for the domain 1. click "Add Proxy Host", with the following settings for grafana. The example uses `grafana.localhost` for the domain
![grafana-host](/_static/images/installation/docker/grafana-host.png)) ![grafana-host](/_static/images/installation/docker/grafana-host.png)
Congrats! You should now see auth running at <http://auth.yourdomain> and grafana at <http://grafana.yourdomain>! Congrats! You should now see auth running at <http://auth.yourdomain> and grafana at <http://grafana.yourdomain>!
@ -59,7 +59,23 @@ There are a handful of ways to add packages:
Using a custom docker image is the preferred approach, as it gives you the stability of packages only changing when you tell them to, along with packages not having to be downloaded every time your container restarts Using a custom docker image is the preferred approach, as it gives you the stability of packages only changing when you tell them to, along with packages not having to be downloaded every time your container restarts
1. Add each additional package that you want to install to a single line in `conf/requirements.txt`. It is recommended, but not required, that you include a version number as well. This will keep your packages from magically updating. You can lookup packages on <https://package.wiki>, and copy everything after `pip install` from the top of the page to use the most recent version. It should look something like `allianceauth-signal-pings==0.0.7`. Every entry in this file should be on a separate line 1. Add each additional package that you want to install to a single line in `conf/requirements.txt`. It is recommended, but not required, that you include a version number as well. This will keep your packages from magically updating. You can lookup packages on <https://package.wiki>, and copy everything after `pip install` from the top of the page to use the most recent version. It should look something like `allianceauth-signal-pings==0.0.7`. Every entry in this file should be on a separate line
1. In `docker compose.yml`, comment out the `image` line under `allianceauth` (line 36... ish) and uncomment the `build` section 1. Modify `docker-compose.yml`, as follows.
* Comment out the `image` line under `allianceauth`
* Uncomment the `build` section
* e.g.
```docker
x-allianceauth-base: &allianceauth-base
# image: ${AA_DOCKER_TAG?err}
build:
context: .
dockerfile: custom.dockerfile
args:
AA_DOCKER_TAG: ${AA_DOCKER_TAG?err}
restart: always
...
```
1. run `docker compose --env-file=.env up -d`, your custom container will be built, and auth will have your new packages. Make sure to follow the package's instructions on config values that go in `local.py` 1. run `docker compose --env-file=.env up -d`, your custom container will be built, and auth will have your new packages. Make sure to follow the package's instructions on config values that go in `local.py`
1. run `docker compose exec allianceauth_gunicorn bash` to open up a terminal inside your auth container 1. run `docker compose exec allianceauth_gunicorn bash` to open up a terminal inside your auth container
1. run `allianceauth update myauth` 1. run `allianceauth update myauth`