DinoDate
DinoDate currently has both Python and NodeJS mid-tier applications and is backed by an Oracle Database.
The following instructions show how to deploy DinoDate to an Oracle Cloud Compute instance. However, if you just need to deploy a NodeJS or Python application, the same instructions should help you install Node and/or Python 3.
If you don’t have access to an Oracle Database you can try the Oracle Cloud for free.
Database
Download/Clone DinoDate to get the database scripts you’ll need.
Create an Oracle Cloud database.
Connect to your database as sys with sysdba and run coreDatabase/dd_master_install.sql. (Use your password and connect string)
1 |
sql sys/YourPassword@YourJdbcConnecString as sysdba @coreDatabase/dd_master_install.sql |
Compute
Create an Oracle Cloud Compute instance.
Open the ports for our NodeJS and Python apps.
Download and scp the following to your new compute instance. (Current versions as of the time of this post.)
- oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
- oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm
- oraclejet.zip (version 4.0.0)
Open an ssh connection to your compute instance. (Use your ssh key and the public IP address for your compute instance)
1 |
ssh -i ~/.ssh/yourKey opc@publicIPforYourCompute |
- Switch to su
- Update your instance
- Install some tools we’ll need
1 2 3 |
sudo su yum update -y yum install -y gcc-c++ make git |
Install both Oracle Instant Client files
1 2 |
yum install -y oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm yum install -y oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm |
Install NodeJS 8
1 2 3 |
curl -sL https://rpm.nodesource.com/setup_8.x | bash - yum install -y nodejs npm install -g pm2 bower |
- Install some tools we’ll need
- Enable the config manager
- Install Python 3.5
- Enable Python 3.5
- Upgrade pip
- Install the python modules for DinoDate
- cx_Oracle
- bottle
- Exit scl bash:
1 2 3 4 5 6 7 |
yum install -y yum-utils yum-config-manager --enable ol7_software_collections yum install -y scl-utils rh-python35 --skip-broken scl enable rh-python35 bash pip install --upgrade pip python -m pip install cx_Oracle bottle --upgrade exit |
Exit su
1 |
exit |
Add the following to your .bash_profile:
- Create the environment variables for DinoDate (use the JDBC connect string for your database)
- Enable Python 3.5.
1 2 3 4 5 6 7 8 9 10 11 12 |
echo " export dd_connectString=YourJdbcConnecString export dd_user=dd export dd_password=dd export dd_port=8888 export dd_python_port=8088 export dd_node_port=3000 export dd_clientAppCodeDir=jet export dd_python_clientAppCodeDir=jet export dd_node_clientAppCodeDir=jet export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib/:$LD_LIBRARY_PATH scl enable rh-python35 bash" >> ~/.bash_profile |
1 |
source ~/.bash_profile |
- Clone DinoDate to your Compute instance
- Extract the Oracle JET files
- Run bower install
1 2 3 4 5 |
git clone https://github.com/OsBlaineOra/dino-date.git unzip ~/oraclejet.zip -d ~/dino-date/commonClient/jet/ cd ~/dino-date/commonClient/jet/ bower install |
- Install the NodeJS modules
- Use pm2 to start the NodeJS version of DinoDate
The –watch parameter will restart the application if the files change.
1 2 3 |
cd ~/dino-date/nodejs/ npm install pm2 start server.js --watch |
- (We already installed the Python modules above)
- Use pm2 to start the NodeJS version of DinoDate
The –watch parameter will restart the application if the files change.
1 2 |
cd ~/dino-date/python pm2 start app.py --watch |
1 |
$(pm2 startup | grep sudo) |
Try it out
Open a browser and pull up DinoDate:
- NodeJS
http://YourComputePublicIP:3000 - Python
http://YourComputePublicIP:8088
You can log in with any of the existing users, such as:
- Bob
bob@example.com - Admin
admin@example.com
Use any value for the password, the application doesn’t check it.
Click on the Search tab and search for ‘eat’ it should return 6 of the pre-loaded dinosaurs.
If you run into any trouble, leave a comment and I’ll be happy to help.
Hello Mr. Carter,
Very helpful article. Thanks. I have followed all steps and deployed a flask application, however after deploying, my application is running on local server rather than production server. Any help would be highly appreciated. Thank you.
[opc@b97774 Oracle]$ python3 app.py
* Serving Flask app “app” (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Howdy Gayatri,
Check that your application run command is using host=’0.0.0.0′
The run command for DinoDate in Python is:
run(host='0.0.0.0', port=os.getenv("dd_python_port") or os.getenv("dd_port") or 8080)
Hello, i have an application, done with nodejs Angularjs and Mongodb and i want to deploy it on oracle. But i want to deploy it on my compute instance and have access on it on my browser just with the domain. Do you have examples or tutorials or steps for me so that i can do it?
Howdy,
I have not done this myself, but I found this blog post that looks like it might have what you’re looking for.
http://rohanwalia.blogspot.com/2018/08/set-up-oracle-cloud-infrastructure-dns.html