Skip to content

Boilerplate for someone who wants to run python code without installing Python on their machine by using Docker.

License

Notifications You must be signed in to change notification settings

mrkhan/py-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Boilerplate for phython projects

Getting Started

# clone it
git clone [email protected]:developit/py-boilerplate.git py-workspace
cd py-workspace

# Make it your own
rm -rf .git && git init

Explaining the Dockerfile and Setup

The VOLUME instruction defines a volume for the /app directory, which is the working directory for the container. This allows you to mount a host directory to the container directory using the -v flag when you run the container.

To build the Docker image, run the following command in the same directory as your Dockerfile:

# sytax
docker build -t <image_name> .

# actual command
docker build -t py-workspace .

To run the container with a host directory mounted to the container directory, use the -v flag followed by the absolute path of the host directory and the container directory:

# sytax
docker run -v /absolute/path/to/host/dir:/app -p 8000:8000 <image_name>

# actual command
docker run -v ./app:/app py-workspace -p 8000:8000

/app folder should contain all your project code

Example code

The sample app.py file in /app folder runs a flask project which should display "Hello, World!!!!" in browser

About

Boilerplate for someone who wants to run python code without installing Python on their machine by using Docker.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published