Fix container priority for docker compose recipe (#3180)

- Cache must be running *before* the server
- Server must be running *before* the worker
This commit is contained in:
Oliver 2022-06-11 19:58:36 +10:00 committed by GitHub
parent 7c28bf1f64
commit 63f1e58ca9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,6 +57,18 @@ services:
- inventree_data:/var/lib/postgresql/data/
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
# InvenTree web server services
# Uses gunicorn as the web server
inventree-server:
@ -67,6 +79,7 @@ services:
- 8000
depends_on:
- inventree-db
- inventree-cache
env_file:
- .env
volumes:
@ -81,7 +94,6 @@ services:
image: inventree/inventree:stable
command: invoke worker
depends_on:
- inventree-db
- inventree-server
env_file:
- .env
@ -113,18 +125,6 @@ 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)