Setting up WebViewer BIM Server
WebViewer BIM Server is a REST server for performing 3D document work.
This server comes packaged as a Docker image available for Linux, MacOS Intel (not in M1) or Windows.
Prerequisites
Server license key provided by Apryse.
Get a trial license key to try for free.
Install Docker CLI.
Setting up Server
Pull latest webviewer bim server image:
docker pull pdftron/webviewer-bim-server:latestConfiguring Server
The BIM server supports both setting configuration through a config file and setting it directly through environment variables. To set configuration through a config file take the following steps:
The configuration file is a JSON file with the following options:
license- The server license keytemp_directory- The temp directory to use for processing. Defaults to./sys/tmplog_directory- The log directory to use for server logs. Defaults to./sys/logsdata_directory- The directory to store cached data in. Defaults to./sys/datalog_level- Sets the logging level. AcceptsDEBUGINFOTRACEWARNnum_threads- The number of concurrent jobs to target. Defaults to number of CPUs detected minus 1.bind_address- The server binding address. Defaults to0.0.0.0port- The server port. Defaults to8085max_cache_size- The maximum cache size before forcing cache deletion. Defaults to 90% of the available disk.force_zero_cache- Force cache to constantly be removed. Defaults tofalserelease_mode- Sets HTTP to release mode, defaults totrue.request_timeout- Maximum time to wait for an HTTP request result in seconds. Defaults to10seconds.job_timeout- Maximum time to wait for a job to complete . Defaults to10minutes.use_https- Iftrue, enables HTTPS and uses the HTTPSPort. Defaults tofalsehttps_port- HTTPS port, defaults to443https_cert_file- The HTTPS public certificate location.https_key_file- The HTTPS private certificate location.allowed_origins- The origins allowed to access the server. Expects a string array['test.com','pdftron.com']allow_credentials- Iftrue, includes the Access-Control-Allow-Credentials header in server responses. Required if usingwithCredentialson client-side API calls.
A sample of what the json file should look like.
In order to pass these arguments as enviroment variables, just run the docker contianer with variable with the prefix trn_, such as:
Running Server
Running with Docker and configuration file
This will mount the config file to the container into the path /home/docjob/config where it will be loaded from.
Running with Docker and environment variables
This will run the container with the trn_license configuration variable defined.
Managing Docker
It's important to maintain uptime when using a Docker container. The best way to do this is with a container management tool such as Portainer, Kubernetes, OpenShift, Docker, ECS and much more.
When managing your container, you can use the built-in health API to monitor its status.
Include credentials in cross-origin BIM requests
If you enabled withCredentials in supported client-side APIs, the BIM server must be configured correctly:
Ensure
allow_credentialsis enabled.Ensure
allowed_originsis not using the default*wildcard.
See client-side documentation for more details.
Last updated
Was this helpful?