mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix various devcontainer issues (#4761)
* Fix various devcontainer issues - fix dubious git ownership during postCreateCommand - fix gpg signing in container - fix local gitconfig in container - add gitlens extension to devcontainer - enable plugins in devcontainer * fix: spelling mistake
This commit is contained in:
parent
9920c3fd9c
commit
7793b3505d
2
.devcontainer/Dockerfile
Normal file → Executable file
2
.devcontainer/Dockerfile
Normal file → Executable file
@ -16,7 +16,7 @@ RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/
|
|||||||
# [Optional] Uncomment this section to install additional OS packages.
|
# [Optional] Uncomment this section to install additional OS packages.
|
||||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && \
|
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && \
|
||||||
apt-get -y install --no-install-recommends \
|
apt-get -y install --no-install-recommends \
|
||||||
git gcc g++ gettext gnupg libffi-dev \
|
git gcc g++ gettext gnupg2 libffi-dev \
|
||||||
# Weasyprint requirements : https://doc.courtbouillon.org/weasyprint/stable/first_steps.html#debian-11
|
# Weasyprint requirements : https://doc.courtbouillon.org/weasyprint/stable/first_steps.html#debian-11
|
||||||
poppler-utils libpango-1.0-0 libpangoft2-1.0-0 \
|
poppler-utils libpango-1.0-0 libpangoft2-1.0-0 \
|
||||||
# Image format support
|
# Image format support
|
||||||
|
@ -40,7 +40,8 @@
|
|||||||
"extensions": [
|
"extensions": [
|
||||||
"ms-python.python",
|
"ms-python.python",
|
||||||
"ms-python.vscode-pylance",
|
"ms-python.vscode-pylance",
|
||||||
"batisteo.vscode-django"
|
"batisteo.vscode-django",
|
||||||
|
"eamodio.gitlens"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -74,13 +75,14 @@
|
|||||||
"INVENTREE_BACKUP_DIR": "/workspaces/InvenTree/dev/backup",
|
"INVENTREE_BACKUP_DIR": "/workspaces/InvenTree/dev/backup",
|
||||||
"INVENTREE_CONFIG_FILE": "/workspaces/InvenTree/dev/config.yaml",
|
"INVENTREE_CONFIG_FILE": "/workspaces/InvenTree/dev/config.yaml",
|
||||||
"INVENTREE_SECRET_KEY_FILE": "/workspaces/InvenTree/dev/secret_key.txt",
|
"INVENTREE_SECRET_KEY_FILE": "/workspaces/InvenTree/dev/secret_key.txt",
|
||||||
|
"INVENTREE_PLUGINS_ENABLED": "True",
|
||||||
"INVENTREE_PLUGIN_DIR": "/workspaces/InvenTree/dev/plugins",
|
"INVENTREE_PLUGIN_DIR": "/workspaces/InvenTree/dev/plugins",
|
||||||
"INVENTREE_PLUGIN_FILE": "/workspaces/InvenTree/dev/plugins.txt",
|
"INVENTREE_PLUGIN_FILE": "/workspaces/InvenTree/dev/plugins.txt",
|
||||||
|
|
||||||
// Python config
|
// Python config
|
||||||
"PIP_USER": "no",
|
"PIP_USER": "no",
|
||||||
|
|
||||||
// used to load the venv into the PATH and avtivate it
|
// used to load the venv into the PATH and activate it
|
||||||
// Ref: https://stackoverflow.com/a/56286534
|
// Ref: https://stackoverflow.com/a/56286534
|
||||||
"VIRTUAL_ENV": "/workspaces/InvenTree/dev/venv",
|
"VIRTUAL_ENV": "/workspaces/InvenTree/dev/venv",
|
||||||
"PATH": "/workspaces/InvenTree/dev/venv/bin:${containerEnv:PATH}"
|
"PATH": "/workspaces/InvenTree/dev/venv/bin:${containerEnv:PATH}"
|
||||||
|
@ -8,7 +8,15 @@ cd /workspaces/InvenTree
|
|||||||
python3 -m venv dev/venv
|
python3 -m venv dev/venv
|
||||||
. dev/venv/bin/activate
|
. dev/venv/bin/activate
|
||||||
|
|
||||||
|
# Avoiding Dubious Ownership in Dev Containers for setup commands that use git
|
||||||
|
git config --global --add safe.directory /workspaces/InvenTree
|
||||||
|
|
||||||
# setup InvenTree server
|
# setup InvenTree server
|
||||||
pip install invoke
|
pip install invoke
|
||||||
inv update
|
inv update
|
||||||
inv setup-dev
|
inv setup-dev
|
||||||
|
|
||||||
|
# remove existing gitconfig created by "Avoiding Dubious Ownership" step
|
||||||
|
# so that it gets copyied from host to the container to have your global
|
||||||
|
# git config in container
|
||||||
|
rm -f /home/vscode/.gitconfig
|
||||||
|
Loading…
Reference in New Issue
Block a user