From 7d25c80996f9a0ab66ea018b5292a09f17746317 Mon Sep 17 00:00:00 2001 From: jojo Date: Sun, 7 Dec 2025 11:49:24 +0000 Subject: [PATCH] verzia 0.1 s image z nexus --- .devcontainer/Dockerfile | 4 +--- .devcontainer/devcontainer.json | 38 +++++++++++++++++++++++++-------- .devcontainer/post_create.sh | 3 +++ README.md | 5 +++-- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 0b3ffac..a186588 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -4,9 +4,7 @@ FROM python:${PYTHON_VERSION}-slim ENV PYTHONUNBUFFERED=1 \ PIP_NO_CACHE_DIR=1 \ - PIP_DISABLE_PIP_VERSION_CHECK=1 \ - VIRTUAL_ENV=/workspace/.venv \ - PATH="/workspace/.venv/bin:${PATH}" + PIP_DISABLE_PIP_VERSION_CHECK=1 # Základ + Docker repo + docker-ce-cli + compose plugin + git RUN set -eux; \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a326b0c..48f8539 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,12 +1,13 @@ { "name": "Python Dev", - "build": { - "dockerfile": "Dockerfile", - "context": ".", - "args": { - "PYTHON_VERSION": "3.13" - } - }, + "image": "docker.masara.eu/python:3.13-0.1-devcontainer", + // "build": { + // "dockerfile": "Dockerfile", + // "context": ".", + // "args": { + // "PYTHON_VERSION": "3.13" + // } + // }, "containerEnv": { "PIP_INDEX_URL": "https://dv.masara.eu/repository/pypi-group/simple" // alebo "/simple", ak to Nexus vyžaduje @@ -37,7 +38,13 @@ ], "editor.formatOnSave": true, "python.defaultInterpreterPath": "/workspace/.venv/bin/python", - "remote.restoreForwardedPorts": false + "python.terminal.activateEnvironment": true, + // nechceme obnovovať staré porty z predchádzajúcich session + "remote.restoreForwardedPorts": false, + // auto-forward portov len na základe outputu, nie procesov + "remote.autoForwardPortsSource": "output", + // vypni auto-attach JS debug (často generuje ghost porty) + "debug.javascript.autoAttachFilter": "disabled" } } }, @@ -48,5 +55,18 @@ "forwardPorts": [ // 8000, // 8080 - ] + ], + "portsAttributes": { + // "8000": { + // "label": "App", + // "onAutoForward": "openBrowser" + // }, + // "8080": { + // "label": "Debug", + // "onAutoForward": "silent" + // }, + "*": { + "onAutoForward": "ignore" + } + } } \ No newline at end of file diff --git a/.devcontainer/post_create.sh b/.devcontainer/post_create.sh index 80da00c..be6d1df 100644 --- a/.devcontainer/post_create.sh +++ b/.devcontainer/post_create.sh @@ -27,3 +27,6 @@ if [ -f "/workspace/requirements.txt" ]; then else echo "requirements.txt nenájdený – preskakujem inštaláciu závislostí." fi + +echo "Nastavujem Git credential helper..." +git config --global credential.helper manager-core diff --git a/README.md b/README.md index bf85dec..8718a40 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,11 @@ > Prvé otvorenie projektu môže trvať aj 10 min. Musí sa buildovať image. -## Otvorenie projektu +## Vytvorenie devcontainera -Pri otvorení projektu sa automaticky: +Pri vytvorení devkontajnera sa automaticky: * kontroluje, či je vytvorené venv, ak nie, vytvorí sa a aktualizuje pip * aktualizujú sa závislosti +* nastaví sa git credential helper