mirror of
https://github.com/umputun/reproxy.git
synced 2024-09-11 08:55:25 +03:00
disable network check by default
This commit is contained in:
parent
ae39b00387
commit
b0dcad19fc
@ -153,6 +153,7 @@ func (d *Docker) listContainers() (res []containerInfo, err error) {
|
||||
|
||||
for _, c := range containers {
|
||||
if !contains(c.State, []string{"running"}) {
|
||||
log.Printf("[DEBUG] skip container %s due to state %s", c.Names[0], c.State)
|
||||
continue
|
||||
}
|
||||
containerName := strings.TrimPrefix(c.Names[0], "/")
|
||||
@ -163,17 +164,19 @@ func (d *Docker) listContainers() (res []containerInfo, err error) {
|
||||
|
||||
var ip string
|
||||
for k, v := range c.Networks.Networks {
|
||||
if k == d.Network { // match on network name
|
||||
if d.Network == "" || k == d.Network { // match on network name if defined
|
||||
ip = v.IPAddress
|
||||
break
|
||||
}
|
||||
}
|
||||
if ip == "" {
|
||||
log.Printf("[DEBUG] skip container %s, no ip on %+v", c.Names[0], c.Networks.Networks)
|
||||
continue
|
||||
}
|
||||
|
||||
port, ok := portExposed(c)
|
||||
if !ok {
|
||||
log.Printf("[DEBUG] skip container %s, no exposed ports", c.Names[0])
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ var opts struct {
|
||||
Docker struct {
|
||||
Enabled bool `long:"enabled" env:"ENABLED" description:"enable docker provider"`
|
||||
Host string `long:"host" env:"HOST" default:"unix:///var/run/docker.sock" description:"docker host"`
|
||||
Network string `long:"network" env:"NETWORK" default:"bridge" description:"docker network"`
|
||||
Network string `long:"network" env:"NETWORK" default:"" description:"docker network"`
|
||||
Excluded []string `long:"exclude" env:"EXCLUDE" description:"excluded containers" env-delim:","`
|
||||
} `group:"docker" namespace:"docker" env-namespace:"DOCKER"`
|
||||
|
||||
|
45
docker-compose.yml
Normal file
45
docker-compose.yml
Normal file
@ -0,0 +1,45 @@
|
||||
|
||||
services:
|
||||
reproxy:
|
||||
build: .
|
||||
image: umputun/reproxy:master
|
||||
hostname: "reproxy"
|
||||
ports:
|
||||
- "80:8080"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
environment:
|
||||
- LISTEN=0.0.0.0:8080
|
||||
- DOCKER_ENABLED=true
|
||||
- DOCKER_NETWORK=reproxy_default
|
||||
- ASSETS_LOCATION=/web
|
||||
- DEBUG=true
|
||||
|
||||
svc1:
|
||||
image: python:3-alpine
|
||||
hostname: svc1
|
||||
ports:
|
||||
- "9091"
|
||||
command: python3 -m http.server 9091
|
||||
|
||||
svc2:
|
||||
image: python:3-alpine
|
||||
hostname: svc2
|
||||
ports:
|
||||
- "9092"
|
||||
command: python3 -m http.server 9092
|
||||
|
||||
# logger:
|
||||
# image: umputun/docker-logger
|
||||
# hostname: "logger"
|
||||
# environment:
|
||||
# - LOG_FILES=true
|
||||
# - LOG_SYSLOG=false
|
||||
# - EXCLUDE=docker-logger
|
||||
# - MAX_FILES=10
|
||||
# - MAX_SIZE=50
|
||||
# - MAX_AGE=20
|
||||
# - DEBUG=false
|
||||
# - TIME_ZONE=America/Chicago
|
||||
# volumes:
|
||||
# - /var/run/docker.sock:/var/run/docker.sock
|
Loading…
Reference in New Issue
Block a user