Merge remote-tracking branch 'inventree/master'

This commit is contained in:
Oliver Walters 2021-04-22 21:59:51 +10:00
commit d9f358a502
8 changed files with 51 additions and 49 deletions

View File

@ -59,6 +59,12 @@ class RuleSet(models.Model):
'authtoken_token',
'authtoken_tokenproxy',
'users_ruleset',
'report_reportasset',
'report_reportsnippet',
'report_billofmaterialsreport',
'report_purchaseorderreport',
'report_salesorderreport',
],
'part_category': [
'part_partcategory',
@ -128,11 +134,6 @@ class RuleSet(models.Model):
'common_colortheme',
'common_inventreesetting',
'company_contact',
'report_reportasset',
'report_reportsnippet',
'report_billofmaterialsreport',
'report_purchaseorderreport',
'report_salesorderreport',
'users_owner',
# Third-party tables

View File

@ -29,16 +29,6 @@ ENV INVENTREE_SECRET_KEY_FILE="${INVENTREE_DATA_DIR}/secret_key.txt"
# Default web server port is 8000
ENV INVENTREE_WEB_PORT="8000"
# Pass DB configuration through as environment variables
# Default configuration = postgresql
ENV INVENTREE_DB_ENGINE="postgresql"
ENV INVENTREE_DB_NAME="inventree"
ENV INVENTREE_DB_HOST="db"
ENV INVENTREE_DB_PORT="5432"
# INVENTREE_DB_USER must be specified at run-time
# INVENTREE_DB_PASSWORD must be specified at run-time
LABEL org.label-schema.schema-version="1.0" \
org.label-schema.build-date=${DATE} \
org.label-schema.vendor="inventree" \

View File

@ -19,8 +19,8 @@ services:
# Use PostgreSQL as the database backend
# Note: this can be changed to a different backend,
# just make sure that you change the INVENTREE_DB_xxx vars below
db:
container_name: db
inventree-db:
container_name: inventree-db
image: postgres
ports:
- 5432/tcp
@ -35,49 +35,60 @@ services:
# InvenTree web server services
# Uses gunicorn as the web server
inventree:
container_name: inventree
inventree-server:
container_name: inventree-server
image: inventree/inventree:latest
expose:
- 8000
depends_on:
- db
- inventree-db
volumes:
- data:/home/inventree/data
- static:/home/inventree/static
environment:
# Default environment variables are configured to match the 'db' container
# Database permissions
# Note: If you change the database image, these will need to be adjusted
# Note: INVENTREE_DB_HOST should match the container name of the database
- INVENTREE_DB_USER=pguser
- INVENTREE_DB_PASSWORD=pgpassword
- INVENTREE_DB_ENGINE=postgresql
- INVENTREE_DB_NAME=inventree
- INVENTREE_DB_HOST=inventree-db
- INVENTREE_DB_PORT=5432
restart: unless-stopped
# Background worker process handles long-running or periodic tasks
worker:
container_name: worker
inventree-worker:
container_name: inventree-worker
image: inventree/inventree:latest
entrypoint: ./start_worker.sh
depends_on:
- db
- inventree
- inventree-db
- inventree-server
volumes:
- data:/home/inventree/data
- static:/home/inventree/static
environment:
# Default environment variables are configured to match the 'inventree' container
# Default environment variables are configured to match the 'db' container
# Note: If you change the database image, these will need to be adjusted
# Note: INVENTREE_DB_HOST should match the container name of the database
- INVENTREE_DB_USER=pguser
- INVENTREE_DB_PASSWORD=pgpassword
- INVENTREE_DB_ENGINE=postgresql
- INVENTREE_DB_NAME=inventree
- INVENTREE_DB_HOST=inventree-db
- INVENTREE_DB_PORT=5432
restart: unless-stopped
# nginx acts as a reverse proxy
# static files are served by nginx
# web requests are redirected to gunicorn
# NOTE: You will need to provide a working nginx.conf file!
proxy:
container_name: proxy
inventree-proxy:
container_name: inventree-proxy
image: nginx
depends_on:
- inventree
- inventree-server
ports:
# Change "1337" to the port that you want InvenTree web server to be available on
- 1337:80

View File

@ -4,9 +4,9 @@ server {
listen 80;
location / {
# Change 'inventree' to the name of the inventree server container,
# Change 'inventree-server' to the name of the inventree server container,
# and '8000' to the INVENTREE_WEB_PORT (if not default)
proxy_pass http://inventree:8000;
proxy_pass http://inventree-server:8000;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;