From ab654c3ae74b10cce355abecd252b3fa3058c76e Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 27 Jul 2022 13:02:26 +1000 Subject: [PATCH] Disable redis image by default (#3416) - Enable using the docker --profile command --- docker/production/.env | 8 +++++--- docker/production/docker-compose.yml | 21 +++++++++------------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/docker/production/.env b/docker/production/.env index 171f2053e6..f61e799362 100644 --- a/docker/production/.env +++ b/docker/production/.env @@ -34,10 +34,12 @@ INVENTREE_DB_PORT=5432 #INVENTREE_DB_USER=pguser #INVENTREE_DB_PASSWORD=pgpassword -# Redis cache setup +# Redis cache setup (disabled by default) +# Un-comment the following lines to enable Redis cache +# Note that you will also have to run docker-compose with the --profile redis command # Refer to settings.py for other cache options -INVENTREE_CACHE_HOST=inventree-cache -INVENTREE_CACHE_PORT=6379 +#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 8377ef9eeb..e691ed7fa2 100644 --- a/docker/production/docker-compose.yml +++ b/docker/production/docker-compose.yml @@ -1,11 +1,11 @@ version: "3.8" -# Docker compose recipe for InvenTree production server, with the following containerized processes +# Docker compose recipe for a production-ready InvenTree setup, with the following containers: # - 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 +# - redis as the cache manager (optional, disabled by default) # --------------------- # READ BEFORE STARTING! @@ -18,10 +18,8 @@ version: "3.8" # Changes made to this file are reflected across all containers! # # IMPORTANT NOTE: -# You should not have to change *anything* within the docker-compose.yml file! +# You should not have to change *anything* within this docker-compose.yml file! # Instead, make any changes in the .env file! -# The only *mandatory* change is to set the INVENTREE_EXT_VOLUME variable, -# which defines the directory (on your local machine) where persistent data are stored. # ------------------------ # InvenTree Image Versions @@ -29,15 +27,12 @@ version: "3.8" # By default, this docker-compose script targets the STABLE version of InvenTree, # image: inventree/inventree:stable # -# To run the LATEST (development) version of InvenTree, change the target image to: -# image: inventree/inventree:latest +# To run the LATEST (development) version of InvenTree, +# change the INVENTREE_TAG variable (in the .env file) to "latest" # # Alternatively, you could target a specific tagged release version with (for example): -# image: inventree/inventree:0.5.3 +# INVENTREE_TAG=0.7.5 # -# NOTE: If you change the target image, ensure it is the same for the following containers: -# - inventree-server -# - inventree-worker services: # Database service @@ -58,11 +53,14 @@ services: restart: unless-stopped # redis acts as database cache manager + # only runs under the "redis" profile : https://docs.docker.com/compose/profiles/ inventree-cache: container_name: inventree-cache image: redis:7.0 depends_on: - inventree-db + profiles: + - redis env_file: - .env expose: @@ -79,7 +77,6 @@ services: - 8000 depends_on: - inventree-db - - inventree-cache env_file: - .env volumes: