# PMFlow Docker Server Deploy Guide ## 1. Prerequisites - Remote host has Docker Engine and Docker Compose plugin. - Remote host can be accessed by SSH. - This machine can run `rsync` and `ssh`. - `docker-compose.yml` and `.env.example` exist in project root. ## 2. Local one-line deploy ```bash bash scripts/deploy_remote_docker.sh ``` Examples: ```bash bash scripts/deploy_remote_docker.sh 192.168.1.100 root /opt/pmflow SSH_KEY=~/.ssh/id_rsa bash scripts/deploy_remote_docker.sh 8.8.8.8 ubuntu /srv/pmflow ``` ## 3. What the script does 1. Create remote target directory. 2. Sync local project with `rsync --delete` (excludes `.git`, `venv`, `node_modules`, `logs`). 3. Create `.env` from `.env.example` when missing. 4. Run `docker compose build && docker compose up -d`. ## 4. Daily operations (local) ```bash bash scripts/docker_stack.sh start bash scripts/docker_stack.sh health bash scripts/docker_stack.sh status bash scripts/docker_stack.sh logs backend bash scripts/docker_stack.sh restart bash scripts/docker_stack.sh stop ``` ## 5. Remote troubleshoot ```bash ssh @ "cd /opt/pmflow && docker compose ps" ssh @ "cd /opt/pmflow && docker compose logs --tail=200 backend" ssh @ "cd /opt/pmflow && docker compose down && docker compose up -d" ```