Sign inSign up

jhoncytech/buster-python

By jhoncytech

•Updated over 5 years ago

Image for development with a simple basic structure

Image
0

977

jhoncytech/buster-python repository overview

Header Logo

⁠Quick reference

  • Maintained by: Jhoncy Tech - JhonnyGO
⁠Pull command

$ docker pull jhoncytech/buster-python:3.9

⁠Features

This image will help you start any development project with a base structure.
With this structure you get:

⁠Tools, software and packages used
  • Debian 10 - Buster
  • Python 3.9
  • Node - npm cli
  • Composer
  • AWS - cli
  • Kubectl
  • Minikube

⁠How to use this image.

⁠Create a Dockerfile in your project

NOTE: use tag depending on python you need

FROM jhoncytech/buster-python:3.9

CMD ["tail", "-f", "/dev/null"]

Then, run the commands to build and run the Docker image:

$ docker build -t my-app .
$ docker run -dit --name my-py-app my-app
⁠Without a Dockerfile

If you don't want to include a Dockerfile in your project, it is sufficient to do the following:

CONTAINER WITH LINUX OS
$ docker run -dit --name my-py-app -v "$PWD":/usr/src/code jhoncytech/buster-python:3.9
CONTAINER WITH WINDOWS OS
$ docker run -dit --name my-py-app -v C:\absolute\path\to\your\windows\folder:/usr/src/code jhoncytech/buster-python:3.9
⁠Docker Compose

FILE MYSQL.ENV


MYSQL_ROOT_PASSWORD=123456
MYSQL_DATABASE=jhoncytech
MYSQL_USER=myuser
MYSQL_PASSWORD=654321

FILE DOCKER-COMPOSE


version: '3.9'

########## SERVICES
services:

	########## MYSQL CONTAINER
	jt-mysql:
		container_name: my-mysql
		image: mysql:5.7
		restart: always
		ports:
			- 3306:3306
		env_file: mysql.env
		volumes:
			- ./volumes/mysql:/var/lib/mysql
		networks:
			-jhoncytech

	########## PYTHON CONTAINER
	jt-python:
		container_name: my-python
		image: jhoncytech/buster-python:3.9
		restart: always
		volumes:
			- ./volumes/py-project:/usr/src/code
		depends_on:
			- jt-mysql
		networks:
			-jhoncytech


networks:
	-jhoncytech
⁠Directory structure.

Just to recap, we create a directory on our local machine called python-docker, then inside the folder we create the docker-compose and mysql.env file as shown.


python-docker
|____ docker-compose
|____ mysql.env

finally we execute the command:

$ docker-compose up -d

⁠Image Variants.

The images come in many flavors, each designed for a specific use case.

  • latest: Last image with Python 3.9
  • 3.9: Python 3.9

jhoncytech/buster-python:TAG

⁠Example => Image with Python 3.9

jhoncytech/buster-python:3.9

⁠Contacts

- Mail: [email protected]
- Web: https://jhoncytech.com
---
- Mail: [email protected]
- Web: https://jhonnygo.com
Header Logo

Tag summary

Content type

Image

Digest

Size

581.6 MB

Last updated

over 5 years ago

docker pull jhoncytech/buster-python