37 lines
1.3 KiB
YAML
37 lines
1.3 KiB
YAML
version: '3.8'
|
|
|
|
# 网桥 -> 方便相互通讯
|
|
networks:
|
|
tengine:
|
|
ipam:
|
|
driver: default
|
|
config:
|
|
- subnet: "172.25.0.0/24"
|
|
|
|
services:
|
|
tengine3:
|
|
image: registry.cn-shanghai.aliyuncs.com/odboy/kenaito:proxy-tengine3 # 镜像由 build.sh 构建
|
|
container_name: tengine3 # 容器名为'tengine3'
|
|
restart: unless-stopped
|
|
ports: # 映射端口
|
|
- "80:80" # http
|
|
- "443:443" # https
|
|
#- "8080:80" # 与其它 web 服务在同一台机器时改用此映射
|
|
volumes: # 数据卷挂载路径设置,将本机目录映射到容器目录
|
|
# 只挂载目录,不要单文件挂载 nginx.conf:单文件挂载在宿主机上编辑会触发 inode 变化,容器内看不到修改
|
|
- "./nginx/conf.d:/usr/local/nginx/conf/conf.d"
|
|
- "./nginx/ssl:/usr/local/nginx/conf/ssl"
|
|
- "./nginx/html:/usr/local/nginx/html"
|
|
- "./nginx/logs:/usr/local/nginx/logs"
|
|
environment: # 设置环境变量,相当于docker run命令中的-e
|
|
TZ: Asia/Shanghai
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "netstat -tln | grep -q ':80 ' && netstat -tln | grep -q ':443 '"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 5s
|
|
networks:
|
|
tengine:
|
|
ipv4_address: 172.25.0.20
|