Development Environment With Docker
Development Environment With Docker
with Docker
Development Environment
In normal case
Development Environment
Container
Container
http
Test1’s
Dev1’s
http
Container
Dev3’s
ssh
ssh
Dev1 DB
Tester1 DB
Dev2 DB
port 8082 port 80 Tester2 DB port 80 port 8084
Dev3 DB
Container
http http
Test2’s
Container
Dev2’s
MySQL Server
port 2202 port 22 port 22 port 2204
ssh ssh
Container
Dev2’s
http://dev2.vsii.com
Container
Test1’s
Dev1 DB
NGINX
Container
Dev1’s Tester1 DB
http dev1 Dev2 DB
Container
Test2’s
Tester2 DB
Dev3 DB
Container
Dev3’s
MySQL Server
ssh http://dev3.vsii.com
http://test2.vsii.com
File system
VietVH’s Solution with Docker
Add new member to the team
sudo configurenewuser.sh newdev newpass
This command does:
Create new user for newdev with his sandbox
Create new Docker container for the new user
Create new MySQL User and Database for him
Config Nginx to point http://newdev.vsii.com to the Docker
container
Clone the git repo to his sanbox
Now, the new workspace for the new user is ready
VietVH’s Solution with Docker
http Newdev’s
Docker container
ssh Newdev’s
Upload source code sandbox
VietVH’s Solution with Docker
User starts working with new Feature Branch form his
Sandbox
SSH to the Docker Machine:
ssh [email protected]
Choose the Feature Branch
startwithbranch.sh Feature1
Install Master Data
dbsetup.sh
Access the project thru http
http://newdev.vsii.com/projectname
VietVH’s Solution with Docker
Demo:
Docker 1.5
Gitlab for Git Repo
Ubuntu Linux 15
Apache 2.4.10
PHP 5.6
Nginx 1.6.2
Drupal as the Project
User: dev1, dev2, tester1
VietVH’s Solution with Docker
Advantages:
Inherits all advantage of ThoLT’s solution
Easy for Technical Leader setups the environment for new
member
Easy for Dev / Tester choose the Feature to work
Easy to do the Testing
Disadvantages:
Developer still must upload his code to his sandbox for Unit
Testing
Actually, he still has his environment in his PC first
Warning: Please no use synchronize code mechanism
It spends so much resource of server for synchronizing
Second Solution: Using Docker in Window
Install Docker Machine in Window ( or Mac, Ubuntu
Desktop )
Pull the built Docker Image from server
This Image is built from Docker file and enable to download
Run Docker Container on Windows
Developer will work on his PC directly, he could do whatever
he wants
Resource
Scripts:
http://gitlab.vsii.com/SEPG/ci-project/tree/vietvh