Deploying the Docker Container
The Docker container makes a Web API available that supports submitting 6 images to be authenticated and has the added benefit of being easy to deploy in a customer’s preferred environment.
Installation
The steps a customer would take to deploy our Docker container would be the following
- Install Docker Desktop - https://docs.docker.com/desktop/install/windows-install/
- Create an
appfolder - Create an
.envfile in the app folder, and specify the values correct values to place inside:
REGISTRY=registry.idscan.net/documentverificationservice-standalone
TAG=REQUEST_LATEST_VERSION_NUMBER_FROM_IDSCAN_SUPPORT
RABBITMQ_USERNAME=REQUEST_RABBITMQ_USERNAME_FROM_IDSCAN_SUPPORT
RABBITMQ_PASSWORD=REQUEST_RABBITMQ_PASSWORD_FROM_IDSCAN_SUPPORT
MINIO_USERNAME=REQUEST_MINIO_USERNAME_FROM_IDSCAN_SUPPORT
MINIO_PASSWORD=REQUEST_MINIO_PASSWORD_FROM_IDSCAN_SUPPORT
POSTGRES_USER=REQUEST_POSTGRES_USER_NAME_FROM_IDSCAN_SUPPORT
POSTGRES_PASSWORD=REQUEST_POSTGRES_PASSWORD_FROM_IDSCAN_SUPPORT
DB_USER=REQUEST_DB_USER_NAME_FROM_IDSCAN_SUPPORT
DB_PASSWORD=REQUEST_DB_PASSWORD_FROM_IDSCAN_SUPPORT
- Create the docker-compose.yml file in the app folder:
services:
dvsapi:
image: ${REGISTRY-idscan}/dvsapi:${TAG}
environment:
- Db=${DB_TYPE-pgsql}
- ConnectionStrings__DVS_pgsql=Host=${DB_HOST-db};Username=${DB_USER};Password=${DB_PASSWORD};Database=${DB_NAME-dvs}
- Init__UserName=${DB_USER}
- RPC__Rabbit__Host=${RABBITMQ_HOST-rabbitmq}
- RPC__Rabbit__UserName=${RABBITMQ_USERNAME}
- RPC__Rabbit__UserPass=${RABBITMQ_PASSWORD}
- Minio__Address=${MINIO_HOST-minio:9000}
- Minio__AccessKey=${MINIO_USERNAME}
- Minio__SecretKey=${MINIO_PASSWORD}
- DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE=false
- ASPNETCORE_URLS=http://+:80
volumes:
- ./License.json:/app/License.json
restart: always
ports:
- 80:80
networks:
- db
- svc
depends_on:
- db
- rabbitmq
deploy:
replicas: 1
resources:
limits:
memory: 1536m
cpus: "0.5"
db:
image: postgres:15
environment:
- POSTGRES_DB=${DB_NAME-dvs}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
restart: always
networks:
- db
deploy:
replicas: 1
resources:
limits:
memory: 128m
cpus: '0.5'
rabbitmq:
image: bitnamilegacy/rabbitmq:3.12.4
environment:
- RABBITMQ_USERNAME=${RABBITMQ_USERNAME}
- RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}
- RABBITMQ_MANAGEMENT_ALLOW_WEB_ACCESS=true
restart: always
ports:
- 15672:15672
networks:
- svc
deploy:
replicas: 1
resources:
limits:
memory: 256m
cpus: "1"
minio:
image: minio/minio:RELEASE.2023-06-29T05-12-28Z
command: server /data --console-address ":9001"
environment:
- MINIO_ROOT_USER=${MINIO_USERNAME}
- MINIO_ROOT_PASSWORD=${MINIO_PASSWORD}
ports:
- 9001:9001
networks:
- svc
deploy:
replicas: 1
resources:
limits:
memory: 512m
cpus: "0.5"
adminer:
image: adminer
restart: always
ports:
- 8080:8080
networks:
- db
depends_on:
- db
deploy:
replicas: 0
#for overlay run: docker swarm init
networks:
db:
driver: overlay
attachable: true
svc:
driver: overlay
attachable: true
Choose ASDK GPU or ASDK CPU version:
- Create the docker-compose.asdk.gpu.yml file in the app folder:
services:
dvsapi:
environment:
- Swagger__Versions=3.0,4.0
- Swagger__Controllers=validation,authentication
- HC__Mrz__IsEnabled=false
- HC__Pdf417__IsEnabled=false
- HC__OurOcr__IsEnabled=false
- HC__Face3Divi__IsEnabled=false
- HC__PreProcessing__IsEnabled=false
- HC__AdditionalChecks__IsEnabled=false
- HC__Authentication__IsEnabled=true
dvsvalidationgpuservice:
image: ${REGISTRY-idscan}/dvsvalidationgpuservice:${TAG}
environment:
- RpcServer__Host=${RABBITMQ_HOST-rabbitmq}
- RpcServer__UserName=${RABBITMQ_USERNAME}
- RpcServer__UserPass=${RABBITMQ_PASSWORD}
- Minio__Address=${MINIO_HOST-minio:9000}
- Minio__AccessKey=${MINIO_USERNAME}
- Minio__SecretKey=${MINIO_PASSWORD}
- DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE=false
volumes:
- ./License.json:/app/License.json
restart: always
networks:
- db
- svc
depends_on:
- dvsapi
- rabbitmq
deploy:
replicas: 1
resources:
limits:
memory: 4G
cpus: "3"
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
- Create the docker-compose.asdk.cpu.yml file in the app folder:
services:
dvsapi:
environment:
- Swagger__Versions=3.0,4.0
- Swagger__Controllers=validation,authentication
- HC__Mrz__IsEnabled=false
- HC__Pdf417__IsEnabled=false
- HC__OurOcr__IsEnabled=false
- HC__Face3Divi__IsEnabled=false
- HC__PreProcessing__IsEnabled=false
- HC__AdditionalChecks__IsEnabled=false
- HC__Authentication__IsEnabled=true
dvsvalidationservice:
image: ${REGISTRY-idscan}/dvsvalidationservice:${TAG}
environment:
- RpcServer__Host=${RABBITMQ_HOST-rabbitmq}
- RpcServer__UserName=${RABBITMQ_USERNAME}
- RpcServer__UserPass=${RABBITMQ_PASSWORD}
- Minio__Address=${MINIO_HOST-minio:9000}
- Minio__AccessKey=${MINIO_USERNAME}
- Minio__SecretKey=${MINIO_PASSWORD}
- DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE=false
volumes:
- ./License.json:/app/License.json
restart: always
networks:
- db
- svc
depends_on:
- dvsapi
- rabbitmq
deploy:
replicas: 1
resources:
limits:
memory: 4G
cpus: "3"
- Create file docker-compose.bridge.yml in the app folder:
networks:
db:
driver: bridge
attachable: true
svc:
driver: bridge
attachable: true
- A license file will be provided by
IDScan.net Support Staffand this file should be namedLicense.jsonand added to the app folder The license file will need to be adjusted to match the below format:
{
"License": {
"Code": "YOUR_CODE_VALUE_HERE_",
"SerialNumber": "YOUR_SERIAL_NUMBER_HERE_",
"Info": "YOUR_INFO_FIELD_HERE",
"IssueDate": "YOUR_ISSUE_DATE_HERE_",
"ExpirationDate": "YOUR_EXP_DATE_HERE_",
"LicenseModel": "YOUR_LICENSE_MODEL_HERE_",
"LicenseeCode": "YOUR_LICENSE_ECODE_HERE",
"Data": "YOUR_DATA_HERE"
},
"LicenseStorage": {
"StoragePath": "license/lic"
}
}
- Open PowerShell or a Bash terminal and change your working directory to the app folder:
cd $PATH_TO_APP_DIR
- Run as compose services:
This command will launch the authentication service that uses a GPU to process submitted documents
docker-compose -f docker-compose.yml -f docker-compose.asdk.gpu.yml -f docker-compose.bridge.yml -p dive up -d
This command will launch the authentication service that uses a CPU to process submitted documents
docker-compose -f docker-compose.yml -f docker-compose.asdk.cpu.yml -f docker-compose.bridge.yml -p dive up -d
- List access tokens (after database initialization)
docker exec $(docker ps -f name=dive-db -q) psql -U dvs -tc 'SELECT * FROM \"AccessTokens\";'
Open Swagger API on http://localhost/docs/index.html
Set authorization header using secret token in format "Bearer $token"
Updating the Docker Container
The process to update the Docker container involves downloading the newly released version from our container image repo, stopping the previous version and starting the new container. This new Docker container version will have the updated version of the ASDK contained inside of it and no other changes will need to be made on the customers side.