Sign inSign up

thesuhu/docker-node-oracle

By thesuhu

Updated 11 months ago

Node.js, Oracle Client (Instant Client 12.2), including SQLPlus and SQLLoader tools

Image
Web servers
0

309

thesuhu/docker-node-oracle repository overview

docker-node-oracle

GitHub workflow Docker pull license

Docker images used to create containers ready with Node.js, Oracle Client (Instant Client 12.2), including SQLPlus and SQLLoader tools. This docker image includes Nodemon and PM2 for both development and production use.

Features

  • Node.js v22.x - Latest Node.js LTS version
  • Oracle Instant Client 12.2 - Complete Oracle client libraries
  • SQL*Plus - Oracle command-line interface
  • SQL*Loader - Oracle data loading utility
  • Nodemon v3.1.10 - Auto-restart during development
  • PM2 v6.0.8 - Production process manager

Usage

Just run the following command to run the container:

docker run -d -t -p <host port>:<your app port> -v <your app host dir>:/usr/src/myapp --name <your container name> thesuhu/docker-node-oracle:{TAG}

Specify the image tag you will use in the above {TAG}. Available tags and their Node details are listed below.

Image TagNodeOracle ClientToolsNodemonPM2
latestv22.x12.2.0.1.0SQLPlus, SQLLoaderv3.1.10v6.0.8
22v22.x12.2.0.1.0SQLPlus, SQLLoaderv3.1.10v6.0.8

Example

Development with Nodemon
docker run -d -t -p 3000:3000 -v /home/thesuhu/myapp:/usr/src/myapp --name myapp-dev thesuhu/docker-node-oracle:22

Once the container is running, open a terminal inside the container and run npm i. Then use nodemon to start your application:

docker exec -it myapp-dev bash
npm i
nodemon index.js

The application will automatically restart every time there is a change in the host directory.

Production with PM2
docker run -d -t -p 3000:3000 -v /home/thesuhu/myapp:/usr/src/myapp --name myapp-prod thesuhu/docker-node-oracle:22

Start your application with PM2:

docker exec -it myapp-prod bash
npm i
pm2 start index.js --name myapp
Using Oracle Tools

Once inside the container, you can use Oracle tools directly:

# SQL*Plus
sqlplus username/password@//hostname:1521/service_name

# SQL*Loader
sqlldr username/password@//hostname:1521/service_name control=data.ctl

Environment Variables

The following environment variables are set in the container:

  • LD_LIBRARY_PATH=/opt/oracle/instantclient
  • OCI_HOME=/opt/oracle/instantclient
  • OCI_LIB_DIR=/opt/oracle/instantclient
  • OCI_INCLUDE_DIR=/opt/oracle/instantclient/sdk/include
  • OCI_VERSION=12
  • PATH=/opt/oracle/instantclient:${PATH}

License

MIT

Tag summary

Content type

Image

Digest

sha256:bc411fd21

Size

554.1 MB

Last updated

11 months ago

docker pull thesuhu/docker-node-oracle