From c6b3422dde910e5810aa3c8fcfa97ffff1f66139 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 16 Jun 2021 22:32:29 +1000 Subject: [PATCH] Updates to docker docs --- docs/start/docker.md | 4 ---- docs/start/docker_prod.md | 28 ++++++++++++++++++---------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/docs/start/docker.md b/docs/start/docker.md index 2847cd5..6508ea1 100644 --- a/docs/start/docker.md +++ b/docs/start/docker.md @@ -40,10 +40,6 @@ InvenTree data are stored inside the container at `/home/inventree/data`. This directory should be mounted as a volume which points to a directory on your local machine. -### Static Directory - -Static files are stored internal to the container instance, at the location `/home/inventree/static` - ### Configuration File As discussed in the [configuration documentation](./config.md), InvenTree run-time settings can be provided in a configuration file. diff --git a/docs/start/docker_prod.md b/docs/start/docker_prod.md index c8e624c..3c72b86 100644 --- a/docs/start/docker_prod.md +++ b/docs/start/docker_prod.md @@ -22,6 +22,13 @@ Firstly, here is the complete `docker-compose.yml` file which can be used "as is The following containers are created: +| Container | Description | +| --- | --- | +| inventree-db | PostgreSQL database | +| inventree-server | Gunicorn web server | +| invenrtee-worker | django-q background worker | +| inventree-proxy | nginx proxy | + #### PostgreSQL Database A postgresql database container which creates a postgres user:password combination (which can be changed). This uses the official [PostgreSQL image](https://hub.docker.com/_/postgres). @@ -38,7 +45,7 @@ Runs the InvenTree background worker process. This spins up a second instance of #### Nginx -Nginx working as a reverse proxy, separating requests for static files and directing everything else to Gunicorn. +Nginx working as a reverse proxy, separating requests for static and media files, and directing everything else to Gunicorn. This container uses the official [nginx image](https://hub.docker.com/_/nginx). @@ -53,20 +60,21 @@ An nginx configuration file must be provided to the image. Use the example confi !!! info "Proxy Pass" If you change the name (or port) of the InvenTree web server container, you will need to also adjust the `proxy_pass` setting in the nginx.conf file! -### Volumes - -There are two container volumes created: - -#### Data +### Data Volume InvenTree stores data which is meant to be persistent (e.g. uploaded media files, database data, etc) in a volume which is mapped to a local system directory. !!! info "Data Directory" Make sure you change the path to the local directory where you want persistent data to be stored. -#### Static +The InvenTree docker server will manage the following directories and files within the 'data' volume: -Static files are shared between multiple containers (but not exposed to the local file system). +| Path | Description | +| --- | --- | +| ./config.yaml | InvenTree server configuration file | +| ./secret_key.txt | Secret key file | +| ./media | Directory for storing uploaded media files | +| ./static | Directory for storing static files | ## Production Setup @@ -76,8 +84,8 @@ With the docker-compose recipe above, follow the instructions below to initializ The following files are required on your local machine (use the examples above, or edit as required): -- docker-compose.yml -- nginx.conf +- [docker-compose.yml](https://github.com/inventree/InvenTree/blob/master/docker/docker-compose.yml) +- [nginx.conf](https://github.com/inventree/InvenTree/blob/master/docker/nginx.conf) !!! info "Command Directory" It is assumed that all commands will be run from the directory where `docker-compose.yml` is located.