- in project root create a Dockerfile
- Make sure docker-compose is installed
- Add a docker-compose.yml file to the django project root
version: '3.7'
services:
web:
build: ./app
command: python manage.py runserver 0.0.0.0:8000
volumes:
- ./app/:/usr/src/app/
ports:
- 8000:8000
env_file:
- ./.env.dev
4. Build it
docker-compose build
5. Run it. -d for detached, but better to see the console output for troubleshooting.
docker-compose up -d
6. View console output (in real time w/ -f tag) if you chose to run in detached mode
docker-compose logs -f