Welcome
Build docker image for python3 & django enviorment, using the Dockerfile in the project root directory.
$ make build
start and login to the docker containers for daily development
$ make debug
Run Unittest in Docker containers
root@django-docker:/src# make test
start django debug server(runserver)
root@django-docker:/src# make server
now you can access http://127.0.0.1:8000/heartbeat/ in browser.
run production mode for testing locally:
$ make production
the website is available at http://127.0.0.1:81, deployed with nginx + uwsgi + wsgi
you can enable below services in the docker-compose.yml file under the project root directory.
- MySQL
- MongoDB
- ES & Kibana
- kafka & kafka-manager
- zookeeper
they are disabled by default.
Be sure to update the depends_on
in docker-compose.yml per the service dependencies of your own project.
when MongoDB service is enabled, it can restore the database dump automatically during the start of MongoDB container.
Instructions:
- dump MongoDB database to local file system. such as, '/mnt/data/proj-name/dump'.
- change the volumes configuration of '/mnt/data/dump' in docker-compose.yml to '/mnt/data/proj-name/dump'
$ make kibana
now you can access http://127.0.0.1:5600/ in browser to play with Kibana
$ make kafka-manager
now you can access http://127.0.0.1:9100/ in browser to play with Kafka-Manager
$ cd deploy
$ make build
$ make run
access http://127.0.0.1:5051/heartbeat/ to confirm it is working
then we can add new API and fake data inside to debug with
export project_name=xxx
git clone https://github.com/JackonYang/django2-python3-docker-tmpl $project_name
cd $project_name
rm -rf .git
# Update README
git init && git add . && git commit -m'django2-python3-docker-tmpl v0.1'
git push -f xxx master