... | ... | @@ -22,29 +22,43 @@ To update: |
|
|
$ git pull
|
|
|
$ docker-compose up -d --build
|
|
|
|
|
|
## Deploying
|
|
|
# Deploying
|
|
|
|
|
|
First make sure to create a production.yml file corresponding to your needs, see [the docker-compose docs](https://docs.docker.com/compose/).
|
|
|
Change the admin password *before building*.
|
|
|
First make sure to create a production.yml file corresponding to your needs, see [the docker-compose docs](https://docs.docker.com/compose/). Be wary that docker does everything in /var/lib/docker rather than the current path, so it's advisable to either override the volumes configuration or the whole docker data directory.
|
|
|
Change the admin password and the secret key in the variables.env file **before building**!
|
|
|
The variables.env file is passed to the containers, some configurations need to be passed directly to the docker-compose build through environement variables on the host.
|
|
|
Change the number of cores used by the queues based on your config, for example if you have 8 cores, leaving 2 for general http and sql:
|
|
|
|
|
|
$ export CELERY_MAIN_CORES=4 # defaults to 3
|
|
|
$ export CELERY_LOW_CORES=2 # defaults to 2
|
|
|
|
|
|
Update the code:
|
|
|
And configure exim (to send emails) with:
|
|
|
|
|
|
$ git pull origin master
|
|
|
$ export MAIL_PRIMARY_HOST=localhost
|
|
|
|
|
|
Alternatively you can create a file called `.env` and write those variables in it, docker will pick them up automatically.
|
|
|
|
|
|
### Update the code:
|
|
|
|
|
|
$ git pull origin master
|
|
|
|
|
|
Build:
|
|
|
### Build:
|
|
|
|
|
|
$ docker-compose -f docker-compose.yml -f production.yml build --build-arg VERSION_DATE="$(git log -1 --format=%ad)"
|
|
|
|
|
|
Run:
|
|
|
### Run:
|
|
|
|
|
|
$ docker-compose -f docker-compose.yml -f production.yml up -d
|
|
|
|
|
|
Setting the domain name:
|
|
|
### Setting the domain name:
|
|
|
|
|
|
When sending emails we don't have access to the request, which means we don't know on which domain to generate urls for. You can set it up here: /admin/sites/site/.
|
|
|
It may become a build option at some point.
|
|
|
|
|
|
### Using a gpu
|
|
|
|
|
|
For now you can only use one gpu, using the KRAKEN_TRAINING_DEVICE setting in the `variables.env` file, so for example:
|
|
|
|
|
|
KRAKEN_TRAINING_DEVICE=cuda:0
|
|
|
|
|
|
You also need to install cuda, cudn and use https://github.com/NVIDIA/nvidia-docker. |