11version : " 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
4237services :
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