官网:https://sonic-cloud.gitee.io/#/Deploy?tag=back-end
参照官网步骤Sonic的Server端与Client端:
0、需提前建数据库库!字符集为utf8,排序规则为utf8_general_ci
1、下载最新版本的 zip 文件到任意目录
2、解压zip文件,更改.env中的信息(其中无需改动docker-compose.yml文件)
1) 初始.env中的文件如下:
2).env的配置项文件内容如下:
3)修改之后.env的文件内容如下:
3、创建容器并启动:执行命令 docker-compose up -d
备注:如果为中国大陆用户,我们建议配置加速镜像源或执行以下指令直接使用加速镜像(后续down的时候需要docker-compose -f docker-compose-zh.yml down)
docker-compose -f docker-compose-zh.yml up -d
执行命令之后如下:
[root@VM-4-13-centos sonic-server-v2.1.2]# ls -la total 28 drwx------ 2 root root 4096 Dec 17 19:03 . drwxr-xr-x 4 root root 4096 Dec 17 18:56 .. -rw------- 1 root root 2667 Dec 14 20:50 docker-compose.yml -rw------- 1 root root 2644 Dec 14 20:50 docker-compose-zh.yml -rw------- 1 root root 6148 Dec 17 18:47 .DS_Store -rw------- 1 root root 934 Dec 17 19:03 .env [root@VM-4-13-centos sonic-server-v2.1.2]# docker-compose -f docker-compose-zh.yml up -d [+] Running 25/25 ⠿ sonic-client-web Pulled 67.0s ⠿ 69692152171a Already exists 0.0s ⠿ 965615a5cec8 Already exists 0.0s ⠿ b141b026b9ce Already exists 0.0s ⠿ 8d70dc384fb3 Already exists 0.0s ⠿ 525e372d6dee Already exists 0.0s ⠿ 6e60219fdb98 Already exists 0.0s ⠿ 953f85205626 Pull complete 18.2s ⠿ a1dba171a2a6 Pull complete 63.1s ⠿ 945f20ecbd9a Pull complete 63.2s ⠿ 101b4c185607 Pull complete 63.3s ⠿ 37779dacc086 Pull complete 63.4s ⠿ 5cead3ef35ba Pull complete 63.5s ⠿ sonic-server-eureka Pulled 35.2s ⠿ c7ed990a2339 Pull complete 1.3s ⠿ 2d72f43af2ee Pull complete 1.7s ⠿ 9f2e9493895e Pull complete 30.8s ⠿ d66be4968cb5 Pull complete 30.9s ⠿ f17f8d53f9d7 Pull complete 32.5s ⠿ sonic-server-gateway Pulled 44.8s ⠿ 8892026759cb Pull complete 41.2s ⠿ sonic-server-controller Pulled 35.3s ⠿ d3caa435b16a Pull complete 32.5s ⠿ sonic-server-folder Pulled 44.8s ⠿ 0388d60b84e4 Pull complete 40.9s [+] Running 6/6 ⠿ Network sonic-server-v212_sonic-network Created 0.1s ⠿ Container sonic-server-v212-sonic-server-eureka-1 Started 1.4s ⠿ Container sonic-server-v212-sonic-server-folder-1 Started 2.0s ⠿ Container sonic-server-v212-sonic-server-controller-1 Started 1.7s ⠿ Container sonic-server-v212-sonic-server-gateway-1 Started 1.9s ⠿ Container sonic-server-v212-sonic-client-web-1 Started 2.7s [root@VM-4-13-centos sonic-server-v2.1.2]# docker-compose -f docker-compose-zh.yml up -d [+] Running 5/5 ⠿ Container sonic-server-v212-sonic-server-eureka-1 Started 11.8s ⠿ Container sonic-server-v212-sonic-server-gateway-1 Started 12.5s ⠿ Container sonic-server-v212-sonic-server-controller-1 Started 12.4s ⠿ Container sonic-server-v212-sonic-server-folder-1 Started 12.0s ⠿ Container sonic-server-v212-sonic-client-web-1 Started 12.9s [root@VM-4-13-centos sonic-server-v2.1.2]# docker-compose -f docker-compose-zh.yml up -d [+] Running 5/0 ⠿ Container sonic-server-v212-sonic-server-eureka-1 Running 0.0s ⠿ Container sonic-server-v212-sonic-server-gateway-1 Running 0.0s ⠿ Container sonic-server-v212-sonic-client-web-1 Running 0.0s ⠿ Container sonic-server-v212-sonic-server-controller-1 Running 0.0s ⠿ Container sonic-server-v212-sonic-server-folder-1 Running 0.0s"/bin/bash" 4 months ago Exited (0) 4 months ago tender_solomon [root@VM-4-13-centos sonic-server-v2.1.2]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 514188619b20 dockerproxy.com/sonicorg/sonic-client-web:v2.1.2 "/docker-entrypoint.…" 24 seconds ago Up 21 seconds 0.0.0.0:3000->80/tcp, :::3000->80/tcp sonic-server-v212-sonic-client-web-1 6d08b61b7401 dockerproxy.com/sonicorg/sonic-server-folder:v2.1.2 "java -server -XX:-U…" 34 seconds ago Up 22 seconds sonic-server-v212-sonic-server-folder-1 1f2a9595285c dockerproxy.com/sonicorg/sonic-server-gateway:v2.1.2 "java -server -XX:-U…" 34 seconds ago Up 22 seconds sonic-server-v212-sonic-server-gateway-1 8452e52eb8a9 dockerproxy.com/sonicorg/sonic-server-controller:v2.1.2 "java -server -XX:-U…" 34 seconds ago Up 22 seconds sonic-server-v212-sonic-server-controller-1 b2f5039dc03d dockerproxy.com/sonicorg/sonic-server-eureka:v2.1.2 "java -server -XX:-U…" 35 seconds ago Up 23 seconds 0.0.0.0:9090->9090/tcp, :::9090->9090/tcp sonic-server-v212-sonic-server-eureka-1
备注:
1)执行命令之后当前sonic-server-v2.1.2下内容如下:
标签:sonic,Container,部署,server,v212,docker,root From: https://www.cnblogs.com/xiaoyanguniang/p/16989393.html