-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
82 lines (77 loc) · 2.87 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
version: '3'
services:
iptables-cloudflare:
build: ./iptables-cloudflare
image: iptables-cloudflare:latest
container_name: ${IPTABLES_SEVICE_NAME:-iptables-cloudflare}
depends_on:
- docker-gen-auto
- proxy-web-auto
restart: unless-stopped
cap_add:
- NET_ADMIN
network_mode: host
proxy-web-auto:
image: nginx:${NGINX_IMAGE_VERSION:-stable-alpine}
container_name: ${NGINX_WEB_SEVICE_NAME:-proxy-web-auto}
restart: always
ports:
- "${IPv4:-0.0.0.0}:${DOCKER_HTTP_:-80}:80"
- "${IPv4:-0.0.0.0}:${DOCKER_HTTPS:-443}:443"
## - "${IPv6:-::0}:${DOCKER_HTTP_:-80}:80"
## - "${IPv6:-::0}:${DOCKER_HTTPS:-443}:443"
environment:
SSL_POLICY: ${SSL_POLICY:-Mozilla-Intermediate}
DEFAULT_HOST: ${DEFAULT_HOST}
## ENABLE_IPV6: "true"
volumes:
- ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
- ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d
- ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html
- ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:ro
- ${NGINX_FILES_PATH:-./data}/htpasswd:/etc/nginx/htpasswd:ro
logging:
driver: ${NGINX_WEB_LOG_DRIVER:-json-file}
options:
max-size: ${NGINX_WEB_LOG_MAX_SIZE:-4m}
max-file: ${NGINX_WEB_LOG_MAX_FILE:-10}
docker-gen-auto:
image: nginxproxy/docker-gen:${DOCKER_GEN_IMAGE_VERSION:-latest}
command: -notify-sighup ${NGINX_WEB_SEVICE_NAME:-proxy-web-auto} -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
container_name: ${DOCKER_GEN_SEVICE_NAME:-docker-gen-auto}
restart: always
volumes:
- ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
- ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d
- ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html
- ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:ro
- ${NGINX_FILES_PATH:-./data}/htpasswd:/etc/nginx/htpasswd:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
logging:
driver: ${NGINX_GEN_LOG_DRIVER:-json-file}
options:
max-size: ${NGINX_GEN_LOG_MAX_SIZE:-2m}
max-file: ${NGINX_GEN_LOG_MAX_FILE:-10}
realip-cloudflare:
build:
context: ./realip-cloudflare
args:
REALIP_IMAGE_VERSION: ${REALIP_IMAGE_VERSION:-latest}
image: realip-cloudflare:latest
container_name: ${REALIP_SEVICE_NAME:-realip-cloudflare}
depends_on:
- docker-gen-auto
- proxy-web-auto
restart: unless-stopped
volumes:
- ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
- /var/run/docker.sock:/tmp/docker.sock:ro
environment:
NGINX_WEB_SEVICE_NAME: ${NGINX_WEB_SEVICE_NAME:-proxy-web-auto}
networks:
default:
external: true
name: ${NETWORK:-proxy}
# external:
# name: ${NETWORK:-proxy}