
Start by running your Docker Desktop application. Then via the command line run the following command to pull the latest postgres image and start an instance.
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword --name postgres_docker postgres
We will now have a Docker image of postgres running with a default database named postgres. To create a new database or to log directly into the instance, we can use the below command.
docker exec -it postgres_docker psql -U postgres

That's with Docker and PostgreSQL setup. Let's now dive into Python project.

Write a comment ...