Sign inSign up

stacktechnologies/docker-python-oracle

By stacktechnologies

•Updated over 6 years ago

Image
0

2.8K

stacktechnologies/docker-python-oracle repository overview

⁠docker-python-oracle

Inspired by valudio/docker-python-flask-oracle⁠
This docker image serves as an environment to execute python scripts with oracle database connection.

⁠build

docker build -t web .

⁠run

docker run -d -p 80:5000 --name web -v <host-absolute-path>:/opt/data/api web

⁠Notes for users using Docker Machine

host-absolute-path: directory on Docker Engine's host

⁠Mount a host directory as a data volume⁠

If you are using Docker Machine on Mac or Windows, your Docker Engine daemon has only limited access to your macOS or Windows filesystem. Docker Machine tries to auto-share your /Users (macOS) or C:\Users (Windows) directory.

On macOS:

docker run -v /Users/<path>:/<container path> ...

On Windows:

docker run -v c:\<path>:c:\<container path>

In the case of VirtualBox you need to make the host folder available as a shared folder in VirtualBox. Then, you can mount it using the Docker -v flag.

⁠Forward host port to Docker Machine⁠

At this time Docker Machine is a virtual machine running under VirtualBox in your machine, so to expose your application port you need to map your virtual machine port to your host port.

docker-machine stop default

Option 1 - Use the VirtualBox interface

  • Open VirtualBox Manager
  • Select your Docker Machine VirtualBox image (e.g.: default)
  • Open Settings -> Network -> Advanced -> Port Forward
  • Add your app name, the desired host port (e.g.: 80) and your Guest port (e.g.: 80)

Option 2 - Use the VirtualBox command line

VBoxManage modifyvm "default" --natpf1 "web,tcp,,80,,80"
docker-machine start default

Tag summary

Content type

Image

Digest

Size

499.3 MB

Last updated

over 6 years ago

docker pull stacktechnologies/docker-python-oracle