Add all the environment variable otherwise it will show Error Connecting with the database
docker build -t my-wordpressdocker run -p 8000:80 -d --env-file .env my-wordpressdocker stop <container_id>docker start <container_id>docker logs <container_id>