Add Docker/Compose setup and fix subpath routing for /toroid deployment

- Add Dockerfile, .dockerignore, and docker-compose.yml to containerize the app
- Add toroid.service systemd unit (uses docker compose)
- Mount presets/ as a bind volume for persistence outside the container
- Fix all fetch() calls in templates to use relative paths (no leading /)
  so they resolve correctly when served under /toroid/ via nginx proxy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Brent Perteet
2026-03-02 23:26:27 +00:00
parent 8e51d36a96
commit 9521e0876d
6 changed files with 52 additions and 12 deletions

View File

@@ -266,7 +266,7 @@
<div class="container">
<div class="header">
<h1>🔧 Manual Simulation</h1>
<a href="/" class="nav-link">⚡ Go to Optimizer</a>
<a href="./" class="nav-link">⚡ Go to Optimizer</a>
</div>
<p class="subtitle">Directly specify tap settings and input voltage to simulate transformer performance</p>
@@ -455,7 +455,7 @@
loading.classList.remove('hidden');
try {
const response = await fetch('/api/simulate', {
const response = await fetch('api/simulate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -523,7 +523,7 @@
// Load transformer info on page load
async function loadTransformerInfo() {
try {
const response = await fetch('/api/transformer_info');
const response = await fetch('api/transformer_info');
const data = await response.json();
// Update tap options based on actual transformer