Merge pull request #84 from outis1one/claude/zealous-heisenberg-8ylloi
Claude/zealous heisenberg 8ylloi
This commit is contained in:
+26
-7
@@ -168,6 +168,12 @@ CBLOCK
|
|||||||
log_info " rsync -av $_snippet_dir/ caddy-host:~/caddy-snippets/ (all at once)"
|
log_info " rsync -av $_snippet_dir/ caddy-host:~/caddy-snippets/ (all at once)"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
write_readme() {
|
||||||
|
local _dir="$1"; shift
|
||||||
|
mkdir -p "$_dir"
|
||||||
|
cat > "$_dir/README.md"
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Globals — ACTUAL_USER/ACTUAL_HOME must come before DOCKER_DIR
|
# Globals — ACTUAL_USER/ACTUAL_HOME must come before DOCKER_DIR
|
||||||
@@ -428,6 +434,25 @@ NGINXCONF
|
|||||||
log_success "nginx config created"
|
log_success "nginx config created"
|
||||||
|
|
||||||
# ── 4. Standalone docker-compose.yml (per-service folder) ────────────────
|
# ── 4. Standalone docker-compose.yml (per-service folder) ────────────────
|
||||||
|
# Only join caddy_net if Caddy is installed — otherwise the network doesn't
|
||||||
|
# exist and docker compose up will fail with "network not found".
|
||||||
|
local _CADDY_NET_BLOCK=""
|
||||||
|
if [ -d "$DOCKER_DIR/caddy" ]; then
|
||||||
|
_CADDY_NET_BLOCK=" networks:
|
||||||
|
- caddy_net
|
||||||
|
"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local _CADDY_NET_SECTION=""
|
||||||
|
if [ -d "$DOCKER_DIR/caddy" ]; then
|
||||||
|
_CADDY_NET_SECTION="
|
||||||
|
networks:
|
||||||
|
caddy_net:
|
||||||
|
external: true
|
||||||
|
name: ${SITE_CADDY_NET:-caddy_net}
|
||||||
|
"
|
||||||
|
fi
|
||||||
|
|
||||||
cat > "$JS99ER_DIR/docker-compose.yml" << COMPOSE
|
cat > "$JS99ER_DIR/docker-compose.yml" << COMPOSE
|
||||||
name: js99er
|
name: js99er
|
||||||
|
|
||||||
@@ -440,13 +465,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "${JS99ER_PORT}:80"
|
- "${JS99ER_PORT}:80"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
${_CADDY_NET_BLOCK}${_CADDY_NET_SECTION}
|
||||||
- caddy_net
|
|
||||||
|
|
||||||
networks:
|
|
||||||
caddy_net:
|
|
||||||
external: true
|
|
||||||
name: \${CADDY_NET:-caddy_net}
|
|
||||||
COMPOSE
|
COMPOSE
|
||||||
log_success "Created js99er/docker-compose.yml"
|
log_success "Created js99er/docker-compose.yml"
|
||||||
|
|
||||||
|
|||||||
@@ -384,6 +384,7 @@ class Handler(BaseHTTPRequestHandler):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
HTTPServer.allow_reuse_address = True
|
||||||
HTTPServer(('0.0.0.0', 8090), Handler).serve_forever()
|
HTTPServer(('0.0.0.0', 8090), Handler).serve_forever()
|
||||||
PYEOF
|
PYEOF
|
||||||
log_success "server.py written"
|
log_success "server.py written"
|
||||||
|
|||||||
Reference in New Issue
Block a user