Running application locally using Docker
Before you begin, ensure you have the following prerequisites:
To check if docker is already installed on your system, open your terminal/command prompt and run:
docker --version
full-version
or starter-kit
cd full-version
The full-version/starter-kit
folder houses essential files for running your Django application with Docker, including:
Dockerfile
: This file defines how your application image is built.docker-compose.yml
: Use this file for orchestrating multi-container Docker applications..dockerignore
: This file specifies which files and directories should be excluded when building Docker images for a more efficient and secure deployment.Execute the following command to build and run the application using Docker:
docker-compose up --build
This will generate a Docker image named full-version-web-project-django
and set up a container named web_project_django
.
Visit http://localhost:5050/ in your browser. The app should be up & running.
Docker python django tutorial: