Build and develop simple django app with Docker
Spesification :
- Django version 3.2.3 (latest version)
- Python version 3.9.5 (latest version)
- MariaDB/MySQL
How to use :
- Clone the repository
git clone https://github.com/geek-id/django-docker.git
- Edit Dockerfile
On the file of Dockerfile you can change django-app-folder
to your folder django environment. Example your django app folder on the djangoproject, so you can type right there /djangoproject
- Edit docker-compose.yml
change this line :
environment:
- MYSQL_DATABASE=app_django_name
- MYSQL_ROOT_PASSWORD=******
- MYSQL_USER=app_django_user
- MYSQL_PASSWORD=******
to your environment you want.
and then change this line :
volumes:
- .:/django-app-folder
to your path folder django project
- Build the docker
docker-compose run django django-admin startproject example
- Run the docker
docker-compose up