3.6 KiB
CADmind deployment
The release has two public origins:
https://maker.robotquan.comserves the static Vite build.https://maker-api.robotquan.comreverse-proxies the Flask/Gunicorn API on the server's local CADmind port.
For the current 1Panel server, use the Docker deployment below. 1Panel itself occupies port 8090, so the CADmind container is published on 127.0.0.1:18090 instead.
Build release archives
From this project directory, run:
./deploy/build-release.sh
The script creates release/cadmind-frontend-maker-*.tar.gz and release/cadmind-backend-maker-*.tar.gz. It intentionally excludes .env, .venv, output, node_modules, and Python caches. Do not upload the local macOS virtual environment to a Linux server.
For a private, direct-upload package that includes the current backend .env and all model/API settings, run:
INCLUDE_SECRETS=1 ./deploy/build-release.sh
This additionally creates release/cadmind-backend-maker-full-*.tar.gz. Treat that archive as a password-equivalent secret: upload it only over SSH/SCP, do not commit it or place it on a public file host, and rotate the API key after any accidental exposure.
Server setup
1Panel Docker deployment
The current server is Alibaba Linux 3 with Python 3.6 and an existing local CAD image; do not try to create a system Python 3.12 virtual environment there. Upload the -full backend archive, extract it, and start the included Compose service:
mkdir -p /srv/cadmind
tar -xzf cadmind-backend-maker-full-*.tar.gz -C /srv/cadmind
mkdir -p /srv/cadmind/backend/output
chmod 600 /srv/cadmind/backend/.env
docker compose -f /srv/cadmind/docker-compose.backend.yml up -d --build
curl http://127.0.0.1:18090/api/health
In 1Panel, configure the maker-api.robotquan.com reverse proxy target as http://127.0.0.1:18090. The Docker service has restart: unless-stopped and persists generated models in /srv/cadmind/backend/output.
Generic Linux deployment
The server should be Linux x86_64/ARM64 with Python 3.12, Nginx, and outbound HTTPS access to api.openai.com.
sudo useradd --system --home /srv/cadmind --shell /usr/sbin/nologin cadmind || true
sudo mkdir -p /srv/cadmind/frontend /srv/cadmind/backend/output
sudo tar -xzf cadmind-frontend-maker-*.tar.gz -C /srv/cadmind/frontend
sudo tar -xzf cadmind-backend-maker-full-*.tar.gz -C /srv/cadmind
sudo chown -R cadmind:cadmind /srv/cadmind
cd /srv/cadmind/backend
sudo -u cadmind python3.12 -m venv .venv
sudo -u cadmind .venv/bin/pip install --upgrade pip
sudo -u cadmind .venv/bin/pip install -r requirements.txt
The -full archive already contains /srv/cadmind/backend/.env with the current OpenAI key, model settings, and CADMIND_CORS_ORIGINS=https://maker.robotquan.com. Keep it readable only by the service user (chmod 600). If using the normal backend archive instead, create this file separately before starting the service.
Install the service and Nginx config:
sudo install -m 0644 /srv/cadmind/cadmind.service /etc/systemd/system/cadmind.service
sudo install -m 0644 /srv/cadmind/nginx-maker.conf /etc/nginx/sites-available/cadmind-maker.conf
sudo ln -sfn /etc/nginx/sites-available/cadmind-maker.conf /etc/nginx/sites-enabled/cadmind-maker.conf
sudo nginx -t
sudo systemctl daemon-reload
sudo systemctl enable --now cadmind
sudo systemctl reload nginx
Create DNS A/AAAA records for both hostnames pointing to this server. Then issue HTTPS certificates:
sudo certbot --nginx -d maker.robotquan.com -d maker-api.robotquan.com
Verify with https://maker-api.robotquan.com/api/health and https://maker.robotquan.com/.