diff --git a/docker/production/.env b/docker/production/.env index 9bf801dba5..055ecff57d 100644 --- a/docker/production/.env +++ b/docker/production/.env @@ -34,6 +34,11 @@ INVENTREE_DB_PORT=5432 #INVENTREE_DB_USER=pguser #INVENTREE_DB_PASSWORD=pgpassword +# Redis cache setup +# Refer to settings.py for other cache options +INVENTREE_CACHE_HOST=inventree-cache +INVENTREE_CACHE_PORT=6379 + # Enable plugins? INVENTREE_PLUGINS_ENABLED=False diff --git a/docker/production/docker-compose.yml b/docker/production/docker-compose.yml index f7549e702b..7308e82b91 100644 --- a/docker/production/docker-compose.yml +++ b/docker/production/docker-compose.yml @@ -1,10 +1,11 @@ version: "3.8" -# Docker compose recipe for InvenTree production server +# Docker compose recipe for InvenTree production server, with the following containerized processes # - PostgreSQL as the database backend # - gunicorn as the InvenTree web server # - django-q as the InvenTree background worker process # - nginx as a reverse proxy +# - redis as the cache manager # --------------------- # READ BEFORE STARTING! @@ -112,6 +113,18 @@ services: - inventree_data:/var/www restart: unless-stopped + # redis acts as database cache manager + inventree-cache: + container_name: inventree-cache + image: redis:7.0 + depends_on: + - inventree-db + env_file: + - .env + ports: + - ${INVENTREE_CACHE_PORT:-6379}:6379 + restart: unless-stopped + volumes: # NOTE: Change /path/to/data to a directory on your local machine # Persistent data, stored external to the container(s)