diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..7105627 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,12 @@ +:80 { + reverse_proxy gpon-monitor:{$LISTEN_PORT} + + header { + -Server + -X-Powered-By + X-Frame-Options SAMEORIGIN + X-Content-Type-Options nosniff + } + + encode gzip +} diff --git a/docker-compose.yml b/docker-compose.yml index 2abd107..68bdf96 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,8 +6,8 @@ services: LISTEN_PORT: ${LISTEN_PORT:-8080} container_name: gpon-monitor restart: unless-stopped - ports: - - "${EXTERNAL_PORT:-8080}:${LISTEN_PORT:-8080}" + expose: + - "${LISTEN_PORT:-8080}" volumes: - ./data/rrd:/data/rrd env_file: @@ -23,6 +23,21 @@ services: retries: 3 start_period: 40s + caddy: + image: caddy:alpine + container_name: gpon-caddy + restart: unless-stopped + ports: + - "${EXTERNAL_PORT:-8080}:80" + environment: + - LISTEN_PORT=${LISTEN_PORT:-8080} + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile:ro + depends_on: + - gpon-monitor + networks: + - gpon-monitor-net + networks: gpon-monitor-net: driver: bridge \ No newline at end of file