-
记录一次Ubuntu系统的程序部署
-
修改IP
-
#修改IPvim /etc/network/interfacesauto ens33iface ens33 inet staticaddress 192.?.?.?netmask 255.255.255.0gateway 192.?.?.?#修改DNSvim /etc/systemd/resolved.conf 或 vi /etc/resolv.confnameserver 192.?.?.?#重启网络service networking restart
-
-
安装docker
-
#先复制docker运行程序文件cp ./docker/* /usr/bin#编辑docker.servicevi /usr/lib/systemd/system/docker.service[Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network-online.target firewalld.service Wants=network-online.target [Service] Type=notify ExecStart=/usr/bin/dockerd ExecReload=/bin/kill -s HUP $MAINPID LimitNOFILE=infinity LimitNPROC=infinity TimeoutStartSec=0 Delegate=yes KillMode=process Restart=on-failure StartLimitBurst=3 StartLimitInterval=60s [Install] WantedBy=multi-user.target#配置docker-composecp ./docker-compose /usr/local/bin/docker-composechmod +x /usr/local/bin/docker-compose#重启相关服务systemctl daemon-reloadsystemctl start dockersystemctl enable docker
-
-
安装java,此处为安装包部署,容器就不用说了,没啥意思
-
vim /etc/profileexport JAVA_HOME=/usr/local/java/java8(java程序所在的目录)export JRE_HOME=${JAVA_HOME}/jreexport CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/libexport PATH=${JAVA_HOME}/bin:$PATHsource /etc/profile
-
-
安装Redis
-
docker run -d --name redis -p 6379:6379 --restart unless-stopped -v /usr/local/redis/data:/data -v /usr/local/redis/conf/redis.conf:/etc/redis/redis.conf redis redis-server /etc/redis/redis.conf --appendonly yes#修改配置文件vim /usr/local/redis/conf/redis.confappendonly yesprotected-mode nobind 0.0.0.0
-
-
安装nginx
-
#创建nginx容器,并将nginx目录映射到宿主机mkdir -p /usr/local/nginx/confmkdir -p /usr/local/nginx/log# 将容器nginx.conf文件复制到宿主机docker run --name nginxconfig -p 9999:80 -d nginxdocker cp nginxconfig:/etc/nginx/nginx.conf /usr/local/nginx/conf/nginx.conf# 将容器conf.d文件夹下内容复制到宿主机docker cp nginxconfig:/etc/nginx/conf.d /usr/local/nginx/conf/conf.d# 将容器中的html文件夹复制到宿主机docker cp nginxconfig:/usr/share/nginx/html /usr/local/nginxdocker run -p 88:80 --restart unless-stopped --name nginx -v /usr/local/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v /usr/local/nginx/conf/conf.d:/etc/nginx/conf.d -v /usr/local/nginx/log:/var/log/nginx -v /usr/local/nginx/html:/usr/share/nginx/html -d nginx
-
-
部署onlyoffice,data目录要给权限,不然可能会启动有问题,从日志里面可以查看报错
-
docker run -i -t -d -p 80:80 --restart=always --privileged=true-v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data -v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice -v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql -e JWT_SECRET=aj-report onlyoffice/documentserver:latest
-
-