docker-compose lnmp
前置条件
ubuntu 安装好 docker 和 docker-compose
编写启动文件
- docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22version: '3'
services:
nginx:
container_name: v-nginx
image: nginx
restart: always
ports:
- 80:80
- 443:443
volumes:
- ./nginx/conf.d:/tmp/nginx/conf.d
mysql:
container_name: v-mysql
image: mysql
environment:
MYSQL_ROOT_PASSWORD: root
ports:
- "3306:3306"
restart: always
volumes:
- ./mysql:/tmp/lib/mysql
运行命令
1 |
|
docker-compose lnmp
http://yoursite.com/2018/08/22/运维/Docker/docker-compose lnmp/