mirror of
https://github.com/umputun/reproxy.git
synced 2025-07-12 22:20:55 +02:00
disable network check by default
This commit is contained in:
@ -153,6 +153,7 @@ func (d *Docker) listContainers() (res []containerInfo, err error) {
|
|||||||
|
|
||||||
for _, c := range containers {
|
for _, c := range containers {
|
||||||
if !contains(c.State, []string{"running"}) {
|
if !contains(c.State, []string{"running"}) {
|
||||||
|
log.Printf("[DEBUG] skip container %s due to state %s", c.Names[0], c.State)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
containerName := strings.TrimPrefix(c.Names[0], "/")
|
containerName := strings.TrimPrefix(c.Names[0], "/")
|
||||||
@ -163,17 +164,19 @@ func (d *Docker) listContainers() (res []containerInfo, err error) {
|
|||||||
|
|
||||||
var ip string
|
var ip string
|
||||||
for k, v := range c.Networks.Networks {
|
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
|
ip = v.IPAddress
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ip == "" {
|
if ip == "" {
|
||||||
|
log.Printf("[DEBUG] skip container %s, no ip on %+v", c.Names[0], c.Networks.Networks)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
port, ok := portExposed(c)
|
port, ok := portExposed(c)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
log.Printf("[DEBUG] skip container %s, no exposed ports", c.Names[0])
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ var opts struct {
|
|||||||
Docker struct {
|
Docker struct {
|
||||||
Enabled bool `long:"enabled" env:"ENABLED" description:"enable docker provider"`
|
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"`
|
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:","`
|
Excluded []string `long:"exclude" env:"EXCLUDE" description:"excluded containers" env-delim:","`
|
||||||
} `group:"docker" namespace:"docker" env-namespace:"DOCKER"`
|
} `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
|
Reference in New Issue
Block a user