2022-08-09 06:06:32 +00:00
|
|
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
|
|
|
// https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/python-3
|
|
|
|
{
|
|
|
|
"name": "InvenTree",
|
|
|
|
"build": {
|
2023-12-04 20:05:48 +00:00
|
|
|
"dockerfile": "../Dockerfile",
|
2022-08-09 06:06:32 +00:00
|
|
|
"context": "..",
|
2023-12-04 20:05:48 +00:00
|
|
|
"target": "devcontainer",
|
2022-08-09 06:06:32 +00:00
|
|
|
"args": {
|
2023-12-04 20:05:48 +00:00
|
|
|
"base_image": "mcr.microsoft.com/vscode/devcontainers/base:alpine-3.18",
|
|
|
|
"workspace": "${containerWorkspaceFolder}"
|
2022-08-09 06:06:32 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
// Configure tool-specific properties.
|
|
|
|
"customizations": {
|
|
|
|
// Configure properties specific to VS Code.
|
|
|
|
"vscode": {
|
|
|
|
// Set *default* container specific settings.json values on container create.
|
|
|
|
"settings": {
|
2023-05-12 07:13:48 +00:00
|
|
|
"python.defaultInterpreterPath": "${containerWorkspaceFolder}/dev/venv/bin/python",
|
2022-08-09 06:06:32 +00:00
|
|
|
"python.linting.enabled": true,
|
|
|
|
"python.linting.pylintEnabled": false,
|
|
|
|
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
|
|
|
|
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
|
|
|
|
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
|
|
|
|
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
|
|
|
|
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
|
|
|
|
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
|
|
|
|
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
|
|
|
|
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
|
|
|
|
},
|
|
|
|
|
|
|
|
// Add the IDs of extensions you want installed when the container is created.
|
|
|
|
"extensions": [
|
|
|
|
"ms-python.python",
|
|
|
|
"ms-python.vscode-pylance",
|
2023-05-05 12:34:42 +00:00
|
|
|
"batisteo.vscode-django",
|
|
|
|
"eamodio.gitlens"
|
2022-08-09 06:06:32 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
2023-12-04 20:05:48 +00:00
|
|
|
"forwardPorts": [5173, 8000],
|
2022-08-09 06:06:32 +00:00
|
|
|
"portsAttributes": {
|
2023-12-04 20:05:48 +00:00
|
|
|
"5173": {
|
|
|
|
"label": "Vite server"
|
|
|
|
},
|
2022-08-09 06:06:32 +00:00
|
|
|
"8000": {
|
|
|
|
"label": "InvenTree server"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
// Use 'postCreateCommand' to run commands after the container is created.
|
2023-05-12 07:13:48 +00:00
|
|
|
"postCreateCommand": "./.devcontainer/postCreateCommand.sh ${containerWorkspaceFolder}",
|
2022-08-09 06:06:32 +00:00
|
|
|
|
|
|
|
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
|
|
|
"remoteUser": "vscode",
|
2023-12-04 20:05:48 +00:00
|
|
|
"containerUser": "vscode",
|
2022-08-09 06:06:32 +00:00
|
|
|
|
|
|
|
"remoteEnv": {
|
2023-01-24 22:29:50 +00:00
|
|
|
// InvenTree config
|
2022-08-09 06:06:32 +00:00
|
|
|
"INVENTREE_DEBUG": "True",
|
2023-09-24 13:01:06 +00:00
|
|
|
"INVENTREE_LOG_LEVEL": "INFO",
|
2022-08-09 06:06:32 +00:00
|
|
|
"INVENTREE_DB_ENGINE": "sqlite3",
|
2023-05-12 07:13:48 +00:00
|
|
|
"INVENTREE_DB_NAME": "${containerWorkspaceFolder}/dev/database.sqlite3",
|
|
|
|
"INVENTREE_MEDIA_ROOT": "${containerWorkspaceFolder}/dev/media",
|
|
|
|
"INVENTREE_STATIC_ROOT": "${containerWorkspaceFolder}/dev/static",
|
|
|
|
"INVENTREE_BACKUP_DIR": "${containerWorkspaceFolder}/dev/backup",
|
|
|
|
"INVENTREE_CONFIG_FILE": "${containerWorkspaceFolder}/dev/config.yaml",
|
|
|
|
"INVENTREE_SECRET_KEY_FILE": "${containerWorkspaceFolder}/dev/secret_key.txt",
|
2023-05-05 12:34:42 +00:00
|
|
|
"INVENTREE_PLUGINS_ENABLED": "True",
|
2023-05-12 07:13:48 +00:00
|
|
|
"INVENTREE_PLUGIN_DIR": "${containerWorkspaceFolder}/dev/plugins",
|
|
|
|
"INVENTREE_PLUGIN_FILE": "${containerWorkspaceFolder}/dev/plugins.txt",
|
2022-08-09 06:06:32 +00:00
|
|
|
|
|
|
|
// Python config
|
|
|
|
"PIP_USER": "no",
|
|
|
|
|
2023-05-05 12:34:42 +00:00
|
|
|
// used to load the venv into the PATH and activate it
|
2022-08-09 06:06:32 +00:00
|
|
|
// Ref: https://stackoverflow.com/a/56286534
|
2023-05-12 07:13:48 +00:00
|
|
|
"VIRTUAL_ENV": "${containerWorkspaceFolder}/dev/venv",
|
|
|
|
"PATH": "${containerWorkspaceFolder}/dev/venv/bin:${containerEnv:PATH}"
|
2022-08-09 06:06:32 +00:00
|
|
|
}
|
|
|
|
}
|