Docker下创建tomcat,mysql,nginx环境

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
version: '3'

services:
mysql:
container_name: jjit_mysql
restart: always
image: mysql:5.7
ports:
- 3306:3306
volumes:
- ./mysql/data:/var/lib/mysql
- ./mysql/my.cnf:/etc/my.cnf
environment:
MYSQL_ROOT_PASSWORD: password

nginx:
container_name: jjit_nginx
restart: always
image: nginx:latest
ports:
- 80:80
- 443:443
volumes:
- ./nginx/www:/usr/share/nginx/html
- ./nginx/conf.d:/etc/nginx/conf.d
- ./nginx/cert:/etc/nginx/cert
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/log/error.log:/var/log/nginx/error.log
links:
- tomcat:t1

tomcat:
container_name: jjit_tomcat
restart: always
image: tomcat:latest
ports:
- 8080:8080
- 8009:8009
- 8443:8443
volumes:
- ./tomcat/webapps:/usr/local/tomcat/webapps
- ./tomcat/conf:/usr/local/tomcat/conf
- ./tomcat/logs:/usr/local/tomcat/logs
links:
- mysql:m1

本文地址: http://hmilyld.com/posts/2786127516.html