Ubuntu 下docker 部署 发表于 2019-06-12 | 分类于 Linux | 阅读次数 安装 1apt-get install -y docker.io nginx docker-compose 1234567891011systemctl start docker systemctl enable docker # 开机启动 systemctl enable nginx systemctl start nginx systemctl stop nginx systemctl restart nginx 配置启动 service 1cd etc/systemd/system/ 123456789101112131415161718[Unit] Description={xxxxx} After=network.target After=docker.service [Service] Type=simple User=root ExecStart={where is docker-compose} up WorkingDirectory={project} Restart=on-failure RestartSec=15 StandardOutput=syslog StandardError=syslog [Install] WantedBy=multi-user.target 12345678# Service 状态 systemctl status endoscope # 启动失败 查看log journalctl -u xxxx.service -f # 更新xxx.service systemctl daemon-reload 本文作者: wyx 本文链接: https://github.com/blog/2019/06/12/deploy-docker 版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 许可协议。转载请注明出处!