1. Install Linux OS for server
•Make
Linux install boot disk
reference:https://jingyan.baidu.com/article/b907e62797ba9146e7891c12.html
•Linux OS:CentOS
•Install Linux OS
2. Prepare enviroment
•Install docker: sudo yum -y install docker
•Start docker: systemctlstart docker
•Download mysql container:
docker run -d --name <data_tag> -p 3306:3306-v /sqldata:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=Newpassword1! -e MYSQL_DATABASE=<database_name> mysql--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
modify config file in project as below:
engine = mysql
host = database
port = 3306
password = Newpassword1!
database = <database_name>
user = root
3. Upload code to server for build
•Server: yum install openssh-server
•PC:
Git bash
Scp (zipfile)dragon_corpusroot@:/home
unzipzipfile(first: yum install –y unzip)
•Config httpd
scp httpd.conf root@<serverIP>:/home/temp/httpd.conf
•Upload Run.sh
scp httpd.conf root@<serverIP>:/home/temp/run.sh(samefolder with Dockerfile)
4. Create image for System
•Prepare Dockerfile
1. create a new folder
2. putdockerfile under the new folder
dockerfile:
3. docker build -t <image_name> .
5. Run image
•docker run -d --link <data_tag> -p 80:80 -v /data:/var/www/html/<System_name>/<System_name>/data --name <container_tag> <image_name>
•docker exec -ti container_tag /bin/bash
6. Dokcer dashboard
sudo curl -L git.io/scope -o /usr/local/bin/scope
sudo chmod a+x /usr/local/bin/scope
scope launch
7. Warning
•Linux path: os.path.sep
•Linux folder acesspermission: Chmod 777
/folder
•WORKDIR: should be set to the correct workdir
•WORKDIR: Can be set as system valialbe
•Logs: record in the log file configed in http.conf
•Container stoped can’t be restart: re-edit run.sh, since
run.sh will be exit, should add some command not to exit the run.sh
•Share the volumn in the machine: should add volumn in
both mysql and
corpus system