-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathdocker-compose.yml
40 lines (37 loc) · 1.23 KB
/
docker-compose.yml
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
version: '3'
services:
nginx:
image: nginx:latest
container_name: nginx
restart: unless-stopped
volumes:
- ./data/nginx/conf.d:/etc/nginx/conf.d
- ./data/nginx/html:/usr/share/nginx/html
- ./logs/nginx:/var/log/nginx
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
ports:
- "80:80"
- "443:443"
links:
- v2ray:v2ray #连接v2ray容器,映射主机名,此处非常重要,如果没有这个映射nginx就无法连接v2ray的websocket服务
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
restart: unless-stopped
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
v2ray:
image: v2ray/official:latest
container_name: v2ray
environment:
- TZ=Asia/Shanghai
restart: always
command: v2ray -config=/etc/v2ray/config.json
volumes:
- ./data/v2ray:/etc/v2ray
- ./logs/v2ray:/var/log/v2ray
expose:
- "30909" #开放端口给容器,不对外开放