buildovanie cez task a verzia na jednom mieste
This commit is contained in:
4
.devcontainer/.env
Normal file
4
.devcontainer/.env
Normal file
@@ -0,0 +1,4 @@
|
||||
PYTHON_BASE=3.13
|
||||
DEVCONTAINER_IMAGE_PULL_REPO=docker.masara.eu/python
|
||||
DEVCONTAINER_IMAGE_PUSH_REPO=repo.masara.eu/python
|
||||
DEVCONTAINER_IMAGE_REV=0.1
|
||||
@@ -1,74 +1,49 @@
|
||||
{
|
||||
"name": "Python Dev",
|
||||
// !! nezabudni nastaviť aj verziu python pre aplikáciu
|
||||
"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",
|
||||
"PIP_ROOT_USER_ACTION": "ignore"
|
||||
},
|
||||
"remoteEnv": {
|
||||
"DOCKER_BUILDKIT": "1",
|
||||
// verzia python pre aplikáciu
|
||||
"PYTHON_BASE": "3.13"
|
||||
},
|
||||
"workspaceFolder": "/workspace",
|
||||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind",
|
||||
"remoteUser": "root",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"ms-python.python",
|
||||
"ms-python.vscode-pylance",
|
||||
"ms-toolsai.jupyter",
|
||||
"ms-python.black-formatter",
|
||||
"ms-python.isort",
|
||||
"ms-azuretools.vscode-docker"
|
||||
],
|
||||
"settings": {
|
||||
"python.formatting.provider": "black",
|
||||
"python.analysis.extraPaths": [
|
||||
"${workspaceFolder}/.venv/lib/python3.13/site-packages",
|
||||
"${workspaceFolder}/app"
|
||||
],
|
||||
"editor.formatOnSave": true,
|
||||
// "python.defaultInterpreterPath": "/workspace/.venv/bin/python",
|
||||
"python.terminal.activateEnvironment": true,
|
||||
"python.defaultInterpreterPath": ".venv/bin/python",
|
||||
// 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"
|
||||
}
|
||||
}
|
||||
},
|
||||
"mounts": [
|
||||
"type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock"
|
||||
],
|
||||
"postCreateCommand": "bash .devcontainer/post_create.sh",
|
||||
"forwardPorts": [
|
||||
// 8000,
|
||||
// 8080
|
||||
],
|
||||
"portsAttributes": {
|
||||
// "8000": {
|
||||
// "label": "App",
|
||||
// "onAutoForward": "openBrowser"
|
||||
// },
|
||||
// "8080": {
|
||||
// "label": "Debug",
|
||||
// "onAutoForward": "silent"
|
||||
// },
|
||||
"*": {
|
||||
"onAutoForward": "ignore"
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
"name": "Python Dev",
|
||||
"dockerComposeFile": "docker-compose.yml",
|
||||
"service": "dev",
|
||||
"containerEnv": {
|
||||
"PIP_INDEX_URL": "https://dv.masara.eu/repository/pypi-group/simple",
|
||||
"PIP_ROOT_USER_ACTION": "ignore"
|
||||
},
|
||||
"remoteEnv": {
|
||||
"DOCKER_BUILDKIT": "1"
|
||||
},
|
||||
"workspaceFolder": "/workspace",
|
||||
"remoteUser": "root",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"ms-python.python",
|
||||
"ms-python.vscode-pylance",
|
||||
"ms-toolsai.jupyter",
|
||||
"ms-python.black-formatter",
|
||||
"ms-python.isort",
|
||||
"ms-azuretools.vscode-docker"
|
||||
],
|
||||
"settings": {
|
||||
"python.formatting.provider": "black",
|
||||
"python.analysis.extraPaths": [
|
||||
"${workspaceFolder}/app"
|
||||
],
|
||||
"editor.formatOnSave": true,
|
||||
"python.terminal.activateEnvironment": true,
|
||||
"python.defaultInterpreterPath": ".venv/bin/python",
|
||||
"remote.restoreForwardedPorts": false,
|
||||
"remote.autoForwardPortsSource": "output",
|
||||
"debug.javascript.autoAttachFilter": "disabled"
|
||||
}
|
||||
}
|
||||
},
|
||||
"mounts": [
|
||||
"type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock"
|
||||
],
|
||||
"postCreateCommand": "bash .devcontainer/post_create.sh",
|
||||
"forwardPorts": [
|
||||
],
|
||||
"portsAttributes": {
|
||||
"*": {
|
||||
"onAutoForward": "ignore"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
9
.devcontainer/docker-compose.yml
Normal file
9
.devcontainer/docker-compose.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
services:
|
||||
dev:
|
||||
image: ${DEVCONTAINER_IMAGE_PULL_REPO}:${PYTHON_BASE}-${DEVCONTAINER_IMAGE_REV}-devcontainer
|
||||
pull_policy: always
|
||||
init: true
|
||||
volumes:
|
||||
- ..:/workspace:cached
|
||||
environment:
|
||||
PYTHON_BASE: ${PYTHON_BASE}
|
||||
Reference in New Issue
Block a user