-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
42 lines (40 loc) · 1.08 KB
/
docker-compose.yaml
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
version: '3.7'
services:
nginx:
container_name: ex-nginx
image: nginx:1.13
restart: always
ports:
- 80:80
- 443:443
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
mysql:
container_name: ex-mysql
image: mysql/mysql-server:5.7
environment:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: root
MYSQL_ROOT_HOST: '%'
ports:
- "13306:3306"
restart: always
web:
image: registry.cn-shenzhen.aliyuncs.com/k9/docker-demo:test
environment:
- "JAVA_OPTS=-Djava.security.egd=file:/dev/./urandom -Dtomcat.name=ex-docker-demo -Dspring.profiles.active=test"
expose:
- "8080"
# ports:
# - "8080:8080"
# 启动依赖
# depends_on:
# - nginx
# - mysql
#使用 command 可以覆盖容器启动后默认执行的命令
command: ["/wait-for-it.sh","-t","0","mysql:3306", "--", "/run.sh"]
# entrypoint: ["/wait-for-it.sh","-t","0","mysql:3306", "--"]
# command: ["/bin/bash","-c","sleep 15 && /run.sh"]
#docker compose会忽略deploy参数,应使用docker-compose scale web=2
# deploy:
# replicas: 2