feat: production deployment setup and hardcoded URL fixes

- Fix hardcoded localhost:8000 URLs in frontend to use relative /api/v1
  path (works with Nginx proxy in prod and VITE_API_URL in dev)
- Create production entrypoint (entrypoint.prod.sh) that runs migrations,
  seeds, and starts uvicorn with 4 workers (no --reload)
- Create comprehensive install.sh script for production deployment that
  generates secure .env, builds containers, waits for health, and
  optionally triggers initial MITRE sync
- Update docker-compose.prod.yml to use production entrypoint
- Update Dockerfile to make both entrypoints executable
- Remove init.ps1 (production will always be Linux)
- Update README with production deployment instructions
This commit is contained in:
2026-02-10 16:04:16 +01:00
parent a3f83c316a
commit 8aec3581a0
9 changed files with 310 additions and 168 deletions

View File

@@ -1,7 +1,9 @@
import axios, { type AxiosError } from "axios";
const API_BASE_URL = import.meta.env.VITE_API_URL || "/api/v1";
const client = axios.create({
baseURL: "http://localhost:8000/api/v1",
baseURL: API_BASE_URL,
headers: { "Content-Type": "application/json" },
});

View File

@@ -19,7 +19,8 @@ export default function TestCreatePage() {
queryFn: async () => {
// We need to find the mitre_id from the technique list
// This is a workaround since we get UUID but need mitre_id
const response = await fetch(`http://localhost:8000/api/v1/techniques`, {
const apiBase = import.meta.env.VITE_API_URL || "/api/v1";
const response = await fetch(`${apiBase}/techniques`, {
headers: {
Authorization: `Bearer ${localStorage.getItem("token")}`,
},