2021-10-20 11:39:42 -04:00
|
|
|
version: "3.8"
|
|
|
|
|
|
|
|
services:
|
|
|
|
inventree-db:
|
|
|
|
container_name: inventree-db
|
|
|
|
image: postgres:13
|
|
|
|
environment:
|
|
|
|
POSTGRES_DB: "${POSTGRES_DB}"
|
|
|
|
POSTGRES_USER: "${POSTGRES_USER}"
|
|
|
|
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
|
|
|
|
volumes:
|
|
|
|
- db:/var/lib/postgresql/data/
|
|
|
|
restart: unless-stopped
|
|
|
|
|
2023-03-30 01:41:18 -04:00
|
|
|
inventree-cache:
|
|
|
|
container_name: inventree-cache
|
|
|
|
image: redis:7.0
|
|
|
|
depends_on:
|
|
|
|
- inventree-db
|
|
|
|
restart: unless-stopped
|
|
|
|
|
2021-10-20 11:39:42 -04:00
|
|
|
inventree-server:
|
|
|
|
container_name: inventree-server
|
2023-03-30 01:32:29 -04:00
|
|
|
build: ./inventree-ldap
|
2021-10-20 11:39:42 -04:00
|
|
|
expose:
|
|
|
|
- 8000
|
|
|
|
depends_on:
|
|
|
|
- inventree-db
|
2023-03-30 01:39:41 -04:00
|
|
|
volumes: &InvenTree_vols
|
2021-10-20 11:39:42 -04:00
|
|
|
- data:/home/inventree/data
|
2023-03-30 01:39:41 -04:00
|
|
|
- ./settings_prod.py:/home/inventree/InvenTree/InvenTree/settings_prod.py:ro
|
2021-10-20 11:39:42 -04:00
|
|
|
environment: &InvenTree_env
|
|
|
|
# Ensure debug is false for a production setup
|
|
|
|
INVENTREE_DEBUG: "False"
|
|
|
|
INVENTREE_LOG_LEVEL: "WARNING"
|
2023-03-30 01:39:41 -04:00
|
|
|
DJANGO_SETTINGS_MODULE: "InvenTree.settings_prod"
|
2021-10-20 11:39:42 -04:00
|
|
|
|
|
|
|
INVENTREE_DB_ENGINE: "postgresql"
|
|
|
|
INVENTREE_DB_HOST: "inventree-db"
|
|
|
|
INVENTREE_DB_PORT: "5432"
|
|
|
|
INVENTREE_DB_NAME: "${POSTGRES_DB}"
|
|
|
|
INVENTREE_DB_USER: "${POSTGRES_USER}"
|
|
|
|
INVENTREE_DB_PASSWORD: "${POSTGRES_PASSWORD}"
|
2023-03-30 01:41:18 -04:00
|
|
|
|
|
|
|
INVENTREE_CACHE_HOST: inventree-cache
|
|
|
|
INVENTREE_CACHE_PORT: 6379
|
2021-10-20 11:39:42 -04:00
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
# Background worker process handles long-running or periodic tasks
|
|
|
|
inventree-worker:
|
|
|
|
container_name: inventree-worker
|
2023-03-30 01:32:29 -04:00
|
|
|
build: ./inventree-ldap
|
2021-10-20 11:39:42 -04:00
|
|
|
command: invoke worker
|
|
|
|
depends_on:
|
|
|
|
- inventree-db
|
|
|
|
- inventree-server
|
2023-03-30 01:39:41 -04:00
|
|
|
volumes: *InvenTree_vols
|
2021-10-20 11:39:42 -04:00
|
|
|
environment: *InvenTree_env
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
inventree-proxy:
|
|
|
|
container_name: inventree-proxy
|
|
|
|
image: nginx:stable
|
|
|
|
depends_on:
|
|
|
|
- inventree-server
|
|
|
|
ports:
|
|
|
|
- 127.0.0.1:31324:80
|
|
|
|
volumes:
|
|
|
|
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
|
|
- data:/var/www
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
db:
|
|
|
|
data:
|