Based on Django REST framework + OAuth project
Configuring Django to work on a many Djangos in a microsevices architecture
- Dependencies
- Creating key SSH
- Download main repository
- Clone Repositories
- Commands to work with docker
To start to work with docker, we need install docker and docker composer as a primary step, in versions that can work with the YAML compose configuration file in version two.
- https://docs.docker.com/engine/installation/#time-based-release-schedule
- https://docs.docker.com/compose/install/
- https://docs.docker.com/compose/compose-file/compose-file-v2/#blkio_config
First, to use docker in windows you must have windows 10 pro or higher, but always pro, or windows server or enterprise. Next, is to download and install the docker installer (https://docs.docker.com/docker-for-windows/install/).
Make sure you install the linux containers.
After is installed, from the Windows PowerShell, we test with the following command and should receive the version of docker:
docker --version
cygwin is a Linux-like open source project package manager for use on windows.
Now, to be able to use the make command and the other regular commands such as cp, pwd etc, we install Cygwin that can be download from (a terminal with the linux functions but on windows):
NOTE 1: In the configuration and downloading page search and select the make command with changing skip option to the version required that is '4.3-1' and should look like the following:
NOTE 2: In case the commands installed are shwon in the bin folder but can not be called from bash or mintty we need to add the route to the bin folder, where are located the commands, and include in the PATH variable of the system.
NOTE 3: In case you need to install another package using Cygwing it is necessary to run the setup again to show you the package manager.
NOTE 4: To use the Cygwin terminal in VSCode it is necessary to have the following configuration in the settings.json
{
"editor.rulers": [79, 90],
"terminal.integrated.shell.windows": "C:\\cygwin64\\bin\\bash.exe",
"terminal.integrated.env.windows": {
"CHERE_INVOKING": "1"
},
"terminal.integrated.shellArgs.windows": [
"--login",
"-i"
],
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
}
Now, to install the make command, that is the main command used in windows we have to download and install Chocolatey (https://chocolatey.org/install) through the following command in the Windows PowerShell as admin mode:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
we should see something like the following:
After is installed chocolatey, we proceed to install the make command running the following instruction:
choco install make
we should see something like the following:
Also is needed the docker-compose command that is installed through:
choco install docker-compose
we should see something like the following:
NOTE: select your system operative for download version of docker.
First step is generate a new ssh key in the next link we found the steps to follow for the new ssh key:
Now we going to configurate our ssh key, with our logged in user go to the following link:
in the following link we find the steps to copy our ssh and configure it in the previous link view:
to download the repository, only need run the next command:
git clone git@github.com:diegoug/
Incase of windows is recommended to donwload and install GitHub desktop that allows you to select and manage the sync from local to/from the repository, it can be downloaded from:
And is require only to login as in the web page.
Now we need run the next commands in order.
$ make create-network
NOTE: In case and error appears like 'docker could not find plugin bridge in v1 plugin registry: plugin not found' the solution can be done by using the command:
docker network create --driver nat ntwk-mnto
$ make build-development
$ make start-development
$ make stop-development