Create your account at https://hub.docker.com/ so you can load the ChemDraw Web Service image into your Linux server using the terminal.
- Copy the chemdraw-web-service-2.1.0-develop-1115.tar.gz file that you received to a Mac OS or Linux device.
- Open the Terminal and update your system, run the following command: sudo apt-get -y update
- Install Docker with the following command: sudo apt install docker.io
- Go to the directory where you have your CDJS22 files
- Run the following command: sudo docker load --input chemdraw-web.tar.gz
You should see the following in your terminal:
c5ff2d88f679: Loading layer 80.33MB/80.33MB
9026a1e01956: Loading layer 2.56kB/2.56kB
2820a25419dd: Loading layer 421.3MB/421.3MB
8a524e312f7b: Loading layer 20.48kB/20.48kB
c4ca29fe6eeb: Loading layer 101.4MB/101.4MB
6ba9ca4870b9: Loading layer 1.526MB/1.526MB
bf045581d7dd: Loading layer 21.72MB/21.72MB
bec08087d41b: Loading layer 71.23MB/71.23MB
Loaded image: pkiinformatics/chemdraw-web-service:2.1.0-develop-1115
- Create a tag for the image so you can push it to your Docker Hub instance, run the following command: sudo docker tag pkiinformatics/chemdraw-web-service:2.1.0-develop-1115 username/cdws22
- Push your image to your Docker Hub with the following command: sudo docker push jorgeacunag/cdws22
You should see the following in your terminal:
Using default tag: latest
The push refers to repository [docker.io/jorgeacunag/cdws22]
bec08087d41b: Pushed
bf045581d7dd: Pushed
6ba9ca4870b9: Pushed
c4ca29fe6eeb: Pushed
8a524e312f7b: Pushed
2820a25419dd: Pushing 401.7MB/413.9MB
9026a1e01956: Pushed
c5ff2d88f679: Pushed
- Create a new AWS EC2 instance with Linux server OS (Ubuntu) and install Docker and NGINX
https://us-east-2.console.aws.amazon.com/ec2/home?region=us-east-2#Home
Server side - Run the following commands:
- sudo adduser cdws
- sudo usermod -aG sudo cdws
- apt-get -y update
- apt install docker.io
- docker login
- sudo docker pull username/cdws22:latest
- sudo docker run --publish 8080:80 username/cdws22:latest
You should see the following in your terminal:
chemdraw-web-service@2.1.0-develop-1115 start
node dist/index.js --port 80
{"level":30,"time":1705423908698,"pid":16,"hostname":"6420937cd934","msg":"Starting ChemDraw Web Service"}
{"level":30,"time":1705423908699,"pid":16,"hostname":"6420937cd934","msg":"Version: 2.1.0-develop-1115 (ChemDrawSDK.Node: 22.2.0-develop.3146, ChemDrawSDK: 22.2.0.0)"}
{"level":30,"time":1705423908700,"pid":16,"hostname":"6420937cd934","msg":"Host information: 0.93 GB system memory (0.35 GB free), 1 CPU cores (Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz)"}
You can test if your ChemDraw Web Service is running with the following link:
http://localhost:8080/1.0/health-full
You should see the following status message:
{"status":"OK","freeMemBytes":499068928,"totalMemBytes":2021941248,"loadAverages":[1.03,0.68,0.31],"version":"2.1.0-develop-1115"}
You can also check the http://localhost:8080/1.0/help for all the RESTful API backend details.
- Install NGINX with the following command: sudo apt install nginx
You can check the following links for further instructions: Ubuntu NGINX | NGINX Official
- Create the index.html file of your ChemDraw JS 22 application following the instructions on page 8 of the ChemDraw JS Developer's Guide.
- Paste your ChemDraw JS application on the following NGINX server path:
/var/www/html. Run your ChemDraw JS 22 application containing the chemdrawweb folder included in the ChemDraw-JS-22.2.0-develop-4378+ff7db48b2.zip that you received.
If you can see the ChemDraw.loadSMILES() result on the drawing pane your NGINX reverse proxy is working correctly.
Details:
ChemDraw JS 22 and ChemDraw Web Service 22 on Linux_Ubuntu Server and NGINX reverse proxy