Using Docker Python SDK to start a PostgreSQL container
- Docker installed on your machine
- Python and pip installed
Use requirements.txt for PyPI installation
pip3 install -r requirements.txt
Setting up PostgreSQL through YAML
image_name: postgres:16
container_name: postgresql_db
connection_info:
database: 'postgres'
user: 'admin'
password: '******'
host: '127.0.0.1'
port: 9527
heartbeat: True
from launcher import pull_image,start,stop
Will automatically pull the Docker image, start the container, and then stop the container
python3 launcher.py
This project is licensed under the MIT License - see the LICENSE.md file for details
Inspiration, code snippets, etc.