Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/inventree/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"available": true,
"short_desc": "Open-source inventory management for parts, components, BOMs, and stock control",
"author": "InvenTree",
"port": 8000,
"port": 80,
"categories": ["data", "utilities"],
"description": "InvenTree is an open-source inventory management system providing intuitive parts management, stock control, BOM management, and supplier tracking. Designed for makers, hobbyists, and small businesses. Features hierarchical categories, custom fields, build orders, REST API, mobile app with barcode scanning, and a plugin ecosystem.",
"tipi_version": 1,
"tipi_version": 2,
"version": "1.5.5",
"source": "https://github.com/inventree/InvenTree",
"website": "https://inventree.org",
Expand Down
39 changes: 39 additions & 0 deletions apps/inventree/data/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
:80 {
encode gzip

request_body {
max_size 100MB
}

# Health check endpoint
handle /api/system/health/* {
reverse_proxy inventree-server:8000
}

# Serve static files (JS, CSS, images)
handle_path /static/* {
header Allow GET,HEAD,OPTIONS
header Access-Control-Allow-Origin *
header Access-Control-Allow-Methods GET,HEAD,OPTIONS
header Access-Control-Allow-Headers Authorization,Content-Type,User-Agent,traceparent
root * /var/www/static
file_server
}

# Serve media files (user uploads) with auth
handle_path /media/* {
header Allow GET,HEAD,OPTIONS
header Access-Control-Allow-Origin *
header Access-Control-Allow-Methods GET,HEAD,OPTIONS
header Access-Control-Allow-Headers Authorization,Content-Type,User-Agent,traceparent
root * /var/www/media
file_server
header Content-Disposition attachment
forward_auth inventree-server:8000 {
uri /auth/
}
}

# All other requests go to the InvenTree Django server
reverse_proxy inventree-server:8000
}
22 changes: 20 additions & 2 deletions apps/inventree/docker-compose.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
{
"name": "inventree-server",
"image": "inventree/inventree:1.5.5",
"isMain": true,
"internalPort": "8000",
"dependsOn": [
"inventree-db",
"inventree-cache"
Expand Down Expand Up @@ -125,6 +123,26 @@
"timeout": "10s",
"retries": 3
}
},
{
"name": "inventree-proxy",
"image": "caddy:alpine",
"isMain": true,
"internalPort": "80",
"dependsOn": [
"inventree-server"
],
"volumes": [
{ "hostPath": "${APP_DATA_DIR}/Caddyfile", "containerPath": "/etc/caddy/Caddyfile" },
{ "hostPath": "${APP_DATA_DIR}/data/static", "containerPath": "/var/www/static" },
{ "hostPath": "${APP_DATA_DIR}/data/media", "containerPath": "/var/www/media" }
],
"healthCheck": {
"test": "wget --spider -q http://127.0.0.1:80/",
"interval": "20s",
"timeout": "5s",
"retries": 10
}
}
]
}
Loading