IT漫步

技术生活札记©Yaohui

基于docker stack部署wordpress

1. Docker Hub上有关于wordpress部署方式的说明,我们使用docker stack方式部署wordpress,为便于部署其它应用,在wordpress前面部署了nginx进行反向代理,docker-compose.yml文件内容如下: nginx处在frontend和backend网络中 wordpress处在backend网络中 mysql处在backend网络中 nginx的配置文件夹,html目录内容,log文件夹镜像到主机上(文件夹映射会自动在host与container之间同步,文件则不会,所以volumes bind最好用文件夹) mysql的数据文件夹镜像到主机上 wordpress的完整目录(/var/www/html)镜像到主机上 wordpress安装目录下的wp-content文件夹保存了所有的插件及上传文件,但主程序(.php文件)在上层文件位中,为了以后的主程序升级,我们把整个目录镜像出去备份 version: "3.3" services: nginx: image: nginx:1.13.8 deploy: mode: "global" labels: - "position=frontend" resources: limits: cpus: "0.1" memory: 50M restart_policy: condition: any ports: - "80:80" volumes: - type: "bind" source: "/etc/nginx/" target: "/etc/nginx/" read_only: true - type: "bind" source: "/var/www/html/" target: "/usr/share/nginx/html" read_only: true …


Git常用操作

有新代码提交后文件冲突,不能pull代码,Git不能像SVN那样自动Merge,可: git stash git pull git stash pop 比较两个commit之前的修改,生成patch文件并apply到其它地方: git diff {较早commit hash} {较新commit hash} > MyPatch.diff git apply MyPatch.diff 从其它分支提取某一个提交并apply到当前分支: git cherry pick {某次commit hash} git reset [<mode>] [<commit>] mode: –hard 放弃本地修改, 重置所有文件状态和修改内容 –mixed 重置所有文件状态, 保留文件内容 –soft 保留本地文件状态和内容 commit commit hash, HEAD, origin/<branch name>




《第七届项目管理国际论坛》精彩点击

《PROJECT MANAGEMENT IN A DISRUPTIVE AGE 颠覆性时代下的项目管理》 –史蒂芬.唐森 PMI网络计划总监 《人才管理与优势识别》 –兰国胜博士,百锐(中国)研究院副院长   《PROJECT MANAGEMENT IN A DISRUPTIVE AGE 颠覆性时代下的项目管理》 — Stephen Townsend, PMI Director, Network Programs / 史蒂芬.唐森 PMI网络计划总监   《人才管理与优势识别》 –兰国胜博士,百锐(中国)研究院副院长


Proudly powered by WordPress