#!/bin/sh
cat > /usr/share/nginx/html/env-config.js << EOF
window._env_ = {
  VITE_API_URL: "${VITE_API_URL:-https://apiautopos.pmiproduct.online/api}",
  VITE_QR_ORDER_URL: "${VITE_QR_ORDER_URL:-http://localhost:5173}",
  VITE_WA_SERVICE_URL: "${VITE_WA_SERVICE_URL:-http://localhost:3001}",
  VITE_USE_DUMMY: "${VITE_USE_DUMMY:-false}"
};
EOF
exec nginx -g 'daemon off;'
