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/ - inventree_data:/var/lib/postgresql/data/
restart: unless-stopped 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 # InvenTree web server services
# Uses gunicorn as the web server # Uses gunicorn as the web server
inventree-server: inventree-server:
@ -67,6 +79,7 @@ services:
- 8000 - 8000
depends_on: depends_on:
- inventree-db - inventree-db
- inventree-cache
env_file: env_file:
- .env - .env
volumes: volumes:
@ -81,7 +94,6 @@ services:
image: inventree/inventree:stable image: inventree/inventree:stable
command: invoke worker command: invoke worker
depends_on: depends_on:
- inventree-db
- inventree-server - inventree-server
env_file: env_file:
- .env - .env
@ -113,18 +125,6 @@ services:
- inventree_data:/var/www - inventree_data:/var/www
restart: unless-stopped 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: volumes:
# NOTE: Change /path/to/data to a directory on your local machine # NOTE: Change /path/to/data to a directory on your local machine
# Persistent data, stored external to the container(s) # Persistent data, stored external to the container(s)