On Linux systems, Docker is an application development platform that packages applications on Docker and then runs debugging on Linux Docker. And Docker is currently one of the hottest software publishers for Linux. This article will introduce the Linux system to use DDocgo to develop Django project tutorial.
Providing a stack of Docker Machine "system configuration" and Docker Compose "multi-container application assembly" allows for the development of a combination of Postgres, Redis and Django projects.
At the end, the stack will include separate containers for each of the following services:
A Web/Django container
A Nginx container
a container of Postgres
Redis of a container
Data container
a
local settings
use Docker "v1.6.1" version of our You will use Docker Compose "v1.2.0" to organize a multi-container application and use Docker Machine "v0.2.0" to create local and cloud Docker hosts. Follow the instructions to install Docker Compose and Machine separately, then test the installation results:
$ docker-machine --version
docker-machine version 0.2.0 (8b9eaf2)
$ docker-compose --version
docker-compose 1.2.0
Next, clone a project from realpython/dockerizing-django or create your own project according to the following project structure:
├── docker-compose.yml
├── nginx
│ ├── Dockerfile
│ └──site-enabled
│ └── django_project
├── production.yml
└── web
│ ├── Dockerfile
│ ├── docker_django
│ │ ├── __init__.py
│ │ ├── apps
│ │ │ ├── __init__.py
│ │ │ └── todo
│ │ │ ├── __init__.py
│ │ │ ├── admin.py
│ │ │ ├ ── models.py
│ │ │ ├── templates
│ │ │ │ ├── _base.html
│ │ │ │ └── home.html
│ │ │ ├── tests.py
│ │ │ ├── urls.py
│ │ │ └── views.py
│ │ ├── settings.py
│ │ ├── urls.py
│ └── wsgi.py
│ ├── manage.py< Br>
│ ├── requirements.txt
│ └── static
│ │ └── main.css/code"
Now we are ready Container Run ……
Docker Machine
To open Docker Machine, simply run:
$ docker-machine create -d virtualbox dev;
INFO[0000] Creating CA: /Users/michael/.docker/machine/certs/ca.pem
INFO[0000] Creating client certificate: /Users/michael/.docker/machine/certs/cert. Pem
INFO[0001] Download Ing boot2docker.iso to /Users/michael/.docker/machine/cache/boot2docker.iso. .
INFO[0035] Creating SSH key. .
INFO[0035] Creating VirtualBox VM. .
INFO[0043] Starting VirtualBox VM. .
INFO[0044] Waiting for VM to start. .
INFO[0094] “dev” has been created and is now the active machine.
INFO[0094] To point your Docker client at it, run this in your shell: eval &ldquo ;$(docker-machine env dev)”
This create command sets up a new Machine "development environment". In fact, it is to download Boot2Docker and start running the VM. Now just specify Docker in the development environment:
$ eval “$(docker-machine env dev)”
Run the following command to see which machine is currently running:
< $> docker-machine ls
NAME ACTIVE DRIVER STATE URL
dev * virtualbox Running tcp://192.168.99.100:2376
Next, we will let Django The Postgres and Redis containers are running. Previous1234Next page Total 4 pages
Now that the network is becoming more and more insecure, many people choose encryption to prevent le
tmpfs is a memory-based file system that can be used after installation. The following small series
In Linux systems, multiple network cards are usually bundled into one logical netwo
LVM is a logical volume management, is a mechanism for disk partition management under Linux, I beli
Solution for Docker container and host time out of sync
Steps to install StarDict software on Linux
Linux can not identify the u disk solution
Debian boot does not enter the graphical interface method
Linux uses the source command method
How to create symbolic links for Linux systems
Linux Zsh command usage example
Linux compression of JPEG images through the command line
Linux method to modify the PATH path summary
How to transform gedit into TextMate in Linux system
How to save paper and save ink on the web page
Solve Windows xp unable to install fonts
How to set up Win10 system to connect to network printer?
Win7 open folder is not the file content but the search interface is going on
Windows 2008 Server Data Security
Windows 7 Smart Create Restore Point Saves Hard Disk Space
Win2008 Terminal Server Remote Program Configuration