fix: postCreate failures (absolute paths, sudo HOME, socket-wait bug)
This commit is contained in:
parent
d4aeab8dbf
commit
80d81b8022
2 changed files with 10 additions and 5 deletions
|
|
@ -23,8 +23,11 @@
|
|||
}
|
||||
},
|
||||
"overrideCommand": false,
|
||||
"postCreateCommand": "sudo -E bash .devcontainer/setup.sh",
|
||||
"postStartCommand": "bash .devcontainer/postStart.sh",
|
||||
// Absolute paths: lifecycle commands run in the image WORKDIR
|
||||
// (/srv/kirche-einfach/backend), not the workspace folder — relative
|
||||
// .devcontainer/... paths fail with "No such file or directory" (exit 127).
|
||||
"postCreateCommand": "sudo -E bash /srv/kirche-einfach/.devcontainer/setup.sh",
|
||||
"postStartCommand": "bash /srv/kirche-einfach/.devcontainer/postStart.sh",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
|
|
|
|||
|
|
@ -11,8 +11,10 @@ REPO=/srv/kirche-einfach
|
|||
# UV_PROJECT_ENVIRONMENT/UV_PYTHON_INSTALL_DIR plus every compose-provided
|
||||
# variable — uv then created a project-local backend/.venv in the bind-mount
|
||||
# instead of using /opt/venv, and sync_flows.py ran without its settings.)
|
||||
# -H repoints HOME to /home/vscode: without it HOME stays /root (from the
|
||||
# outer sudo) and uv/pip caches fail with Permission denied.
|
||||
as_vscode() {
|
||||
sudo -u vscode -E bash -c "$*"
|
||||
sudo -H -u vscode -E bash -c "$*"
|
||||
}
|
||||
|
||||
# Venv lives outside the bind-mount (see backend/Dockerfile).
|
||||
|
|
@ -71,13 +73,13 @@ targets = [("langflow", 7860), ("lfx", 6004)]
|
|||
deadline = time.time() + 180
|
||||
pending = dict(targets)
|
||||
while pending and time.time() < deadline:
|
||||
for host, port in list(pending):
|
||||
for host, port in list(pending.items()):
|
||||
s = socket.socket()
|
||||
s.settimeout(2)
|
||||
try:
|
||||
s.connect((host, port))
|
||||
print(f"OK {host}:{port}", flush=True)
|
||||
del pending[(host, port)]
|
||||
del pending[host]
|
||||
except OSError:
|
||||
pass
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue