Skip to content

Commit ab654c3

Browse files
Disable redis image by default (#3416)
- Enable using the docker --profile command
1 parent 74fbd30 commit ab654c3

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

docker/production/.env

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ INVENTREE_DB_PORT=5432
3434
#INVENTREE_DB_USER=pguser
3535
#INVENTREE_DB_PASSWORD=pgpassword
3636

37-
# Redis cache setup
37+
# Redis cache setup (disabled by default)
38+
# Un-comment the following lines to enable Redis cache
39+
# Note that you will also have to run docker-compose with the --profile redis command
3840
# Refer to settings.py for other cache options
39-
INVENTREE_CACHE_HOST=inventree-cache
40-
INVENTREE_CACHE_PORT=6379
41+
#INVENTREE_CACHE_HOST=inventree-cache
42+
#INVENTREE_CACHE_PORT=6379
4143

4244
# Enable plugins?
4345
INVENTREE_PLUGINS_ENABLED=False

docker/production/docker-compose.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
version: "3.8"
22

3-
# Docker compose recipe for InvenTree production server, with the following containerized processes
3+
# Docker compose recipe for a production-ready InvenTree setup, with the following containers:
44
# - PostgreSQL as the database backend
55
# - gunicorn as the InvenTree web server
66
# - django-q as the InvenTree background worker process
77
# - nginx as a reverse proxy
8-
# - redis as the cache manager
8+
# - redis as the cache manager (optional, disabled by default)
99

1010
# ---------------------
1111
# READ BEFORE STARTING!
@@ -18,26 +18,21 @@ version: "3.8"
1818
# Changes made to this file are reflected across all containers!
1919
#
2020
# IMPORTANT NOTE:
21-
# You should not have to change *anything* within the docker-compose.yml file!
21+
# You should not have to change *anything* within this docker-compose.yml file!
2222
# Instead, make any changes in the .env file!
23-
# The only *mandatory* change is to set the INVENTREE_EXT_VOLUME variable,
24-
# which defines the directory (on your local machine) where persistent data are stored.
2523

2624
# ------------------------
2725
# InvenTree Image Versions
2826
# ------------------------
2927
# By default, this docker-compose script targets the STABLE version of InvenTree,
3028
# image: inventree/inventree:stable
3129
#
32-
# To run the LATEST (development) version of InvenTree, change the target image to:
33-
# image: inventree/inventree:latest
30+
# To run the LATEST (development) version of InvenTree,
31+
# change the INVENTREE_TAG variable (in the .env file) to "latest"
3432
#
3533
# Alternatively, you could target a specific tagged release version with (for example):
36-
# image: inventree/inventree:0.5.3
34+
# INVENTREE_TAG=0.7.5
3735
#
38-
# NOTE: If you change the target image, ensure it is the same for the following containers:
39-
# - inventree-server
40-
# - inventree-worker
4136

4237
services:
4338
# Database service
@@ -58,11 +53,14 @@ services:
5853
restart: unless-stopped
5954

6055
# redis acts as database cache manager
56+
# only runs under the "redis" profile : https://docs.docker.com/compose/profiles/
6157
inventree-cache:
6258
container_name: inventree-cache
6359
image: redis:7.0
6460
depends_on:
6561
- inventree-db
62+
profiles:
63+
- redis
6664
env_file:
6765
- .env
6866
expose:
@@ -79,7 +77,6 @@ services:
7977
- 8000
8078
depends_on:
8179
- inventree-db
82-
- inventree-cache
8380
env_file:
8481
- .env
8582
volumes:

0 commit comments

Comments
 (0)