Using Docker
This section explains how to deploy a PAS instance using the official PAS docker image, available on Docker Hub as accusoft/prizmdoc-application-services.
Note that PAS requires a connection to PrizmDoc Server. For the rest of this section, we assume that you already have a PrizmDoc Server instance or tier deployed. If that's not the case, you might be interested in our Minimal Backend Quick Start which explains how you can quickly deploy a single instance of PAS and PrizmDoc Server together.
Requirements
To run PAS as a Docker container, you simply need a Docker host (a machine with Docker installed). See the Docker documentation for more information.
1. Create a PAS config file
Before you can run PAS, you'll need a config file. We've included a special init-config
command in our Docker image which you can use to create an initial config file.
Windows (PowerShell)
First, make sure you've created a config
directory on your host file system. This will be the directory where your new config file will be created:
mkdir config
Then, use the Docker image's init-config
command to create a new PAS config file:
docker run --rm -e ACCEPT_EULA=YES --volume $pwd/config:/config accusoft/prizmdoc-application-services init-config
This will create a new PAS config file on your Windows host filesystem at .\config\pcc.nix.yml
.
Linux (bash)
Use the Docker image's init-config
command to create a new PAS config file:
docker run --rm -e ACCEPT_EULA=YES --volume $(pwd)/config:/config accusoft/prizmdoc-application-services init-config
This will create a new PAS config file on your host filesystem at ./config/pcc.nix.yml
.
2. Customize your PAS config file
You will need to customize the contents of the pcc.nix.yml
file for your PAS deployment.
NOTE: On a Linux system, because the config file was created by a Docker container, you will need to either edit the config file as root or change the owner of the file before editing it.
Typically, you need to:
- Change the
secretKey
to your own value (see PAS Configuration for more information). -
Configure your connection to PrizmDoc Server by updating the
pccServer
properties:pccServer.hostName: your-prizmdoc-server-host pccServer.port: 18681 pccServer.scheme: http
-
Configure your storage options.
For more information, see PAS Configuration.
3. Start PAS
Assuming you have configured PAS to run on port 3000
and use ./config
, ./logs
, and ./data
directories, you can start PAS like so:
Windows (PowerShell)
First, create directories for logs and data:
mkdir logs
mkdir data
Then, start a pas
container:
docker run --rm --env ACCEPT_EULA=YES --publish 3000:3000 --volume $pwd/config:/config --volume $pwd/logs:/logs --volume $pwd/data:/data --name pas accusoft/prizmdoc-application-services
Linux (bash)
Start a pas
container like so:
docker run --rm --env ACCEPT_EULA=YES --publish 3000:3000 --volume $(pwd)/config:/config --volume $(pwd)/logs:/logs --volume $(pwd)/data:/data --name pas accusoft/prizmdoc-application-services
In the examples above:
--rm
ensures the container is automatically deleted when it stops.--env ACCEPT_EULA=YES
indicates you have accepted the PrizmDoc Viewer license agreement.--publish 3000:3000
publishes the container's port to the host. This assumes PAS was configured to use port 3000. If you have configured PAS to use a different port, adjust accordingly.--volume $(pwd)/config:/config
maps a host config directory into the container. Your local config directory must contain thepcc.nix.yml
config file created earlier.--volume $(pwd)/logs:/logs
maps a local logs directory into the container. After the container stops, the logs will remain in this directory.--volume $(pwd)/data:/data
maps a local data directory into the container. After the container stops, the data will remain in this directory and can be used again when restarting the container.--name pas
sets the name of the running container.accusoft/prizmdoc-application-services
is the image that should be run.
If you want to start the Docker container in the background, add the -d
option to docker run
to run the container in disconnected mode.
4. Check PAS health
After starting PAS, GET http://localhost:3000/health
should return HTTP 200, indicating PAS is healthy. If you visit this URL in a browser, you should see "OK" in the body of the page.
Windows (PowerShell)
Invoke-WebRequest -Uri http://localhost:3000/health
Should output something like:
StatusCode : 200
StatusDescription : OK
Content : {79, 75}
RawContent : HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 2
Date: Thu, 21 Nov 2019 17:49:35 GMT
OK
Headers : {[Connection, keep-alive], [Content-Length, 2], [Date, Thu, 21 Nov 2019 17:49:35
GMT]}
RawContentLength : 2
Linux (bash)
curl -i http://localhost:3000/health
Should output something like:
HTTP/1.1 200 OK
Date: Wed, 20 Nov 2019 20:00:39 GMT
Connection: keep-alive
Content-Length: 2
OK
5. Check PAS's connection to PrizmDoc Server
After starting PAS, GET http://localhost:3000/servicesConnection
should return HTTP 200, indicating PAS is configured correctly to make requests to PrizmDoc Server. If you visit this URL in a browser, you should see "OK" in the body of the page.
Windows (PowerShell)
Invoke-WebRequest -Uri http://localhost:3000/servicesConnection
Should output something like:
StatusCode : 200
StatusDescription : OK
Content : {79, 75}
RawContent : HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 2
Date: Thu, 21 Nov 2019 17:50:11 GMT
OK
Headers : {[Connection, keep-alive], [Content-Length, 2], [Date, Thu, 21 Nov 2019 17:50:11
GMT]}
RawContentLength : 2
Linux (bash)
curl -i http://localhost:3000/servicesConnection
Should output something like:
HTTP/1.1 200 OK
Date: Wed, 20 Nov 2019 20:00:39 GMT
Connection: keep-alive
Content-Length: 2
OK
5. Stopping the container
You can stop your named container with:
docker stop pas