76 lines
1.9 KiB
YAML
76 lines
1.9 KiB
YAML
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
|
|
|
|
inventree-cache:
|
|
container_name: inventree-cache
|
|
image: redis:7.0
|
|
depends_on:
|
|
- inventree-db
|
|
restart: unless-stopped
|
|
|
|
inventree-server:
|
|
container_name: inventree-server
|
|
build: ./inventree-ldap
|
|
expose:
|
|
- 8000
|
|
depends_on:
|
|
- inventree-db
|
|
volumes: &InvenTree_vols
|
|
- data:/home/inventree/data
|
|
- ./settings_prod.py:/home/inventree/InvenTree/InvenTree/settings_prod.py:ro
|
|
environment: &InvenTree_env
|
|
# Ensure debug is false for a production setup
|
|
INVENTREE_DEBUG: "False"
|
|
INVENTREE_LOG_LEVEL: "WARNING"
|
|
DJANGO_SETTINGS_MODULE: "InvenTree.settings_prod"
|
|
|
|
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}"
|
|
|
|
INVENTREE_CACHE_HOST: inventree-cache
|
|
INVENTREE_CACHE_PORT: 6379
|
|
restart: unless-stopped
|
|
|
|
# Background worker process handles long-running or periodic tasks
|
|
inventree-worker:
|
|
container_name: inventree-worker
|
|
build: ./inventree-ldap
|
|
command: invoke worker
|
|
depends_on:
|
|
- inventree-db
|
|
- inventree-server
|
|
volumes: *InvenTree_vols
|
|
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:
|