//! One-off: expose nginx_1v over TCP and hold it for an external wrk run.
use std::time::Duration;
fn main() {
    let home = std::env::var("HOME").unwrap();
    let image = supermachine::Image::from_snapshot(format!(
        "{home}/.local/supermachine-snapshots/nginx_1v"
    ))
    .expect("nginx_1v snapshot");
    let pool = image
        .pool()
        .min(1)
        .max(1)
        .idle_timeout(Duration::MAX)
        .restore_on_release(false)
        .build()
        .expect("pool");
    let vm = pool.acquire().expect("acquire");
    let fwd = vm.expose_tcp(18080, 80).expect("expose_tcp");
    println!("READY {}", fwd.local_addr());
    std::thread::sleep(Duration::from_secs(40));
}
