Build the Docker image:
docker build -t portfolio .
portfolio is the name of the image, you can chose it however you like.
Verify/check the image(s) on your machine:
docker images
Start/run the container of the local Docker image:
docker run -p 8000:8000 -e SECRET_KEY=secret -e ALLOWED_HOSTS='*' -e DEBUG=True portfolio
go to url: http://0.0.0.0:8000 in your browser and you should see your website.
Verify running container:
docker ps
Verify all container, even already stopped:
docker ps -a
-a --all (displays all container)
Removes all stopped/unused containers:
docker container prune -f
-f (--force)
If your local Docker image is working fine then the next steps are:
Tag your local image with the Docker Hub repository name:
docker tag portfolio your_username/portfolio:latest
portfolio: is the name of the local repository
your_username/portfolio: your_username is your username of Docker Hub. and "/portfolio" is the name of your Docker Hub repository.
Login into Docker Hub:
docker login -u your_username
Push the tagged image to Docker Hub:
docker push your_username/portfolio:latest
latest: is the tagname, the tag version