Image for development with a simple basic structure
977
$ docker pull jhoncytech/buster-python:3.9
This image will help you start any development project with a base structure.
With this structure you get:
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
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
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
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
The images come in many flavors, each designed for a specific use case.
jhoncytech/buster-python:TAG
jhoncytech/buster-python:3.9
- Mail: [email protected]
- Web: https://jhoncytech.com
---
- Mail: [email protected]
- Web: https://jhonnygo.com

Content type
Image
Digest
Size
581.6 MB
Last updated
over 5 years ago
docker pull jhoncytech/buster-python