2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-31 17:11:34 +00:00

Refactor docker image for devcontainer (#6029)

* Make base image configurable

* Refactor dockerfile

- Place extra packages into extra shell script
- Add pre-build stage where packages are installed, and then cache removed
- Run same script in dev target, but do not remove

* Run docker workflow whenever package requirements change

* Replace devcontainer dockerfile

* Install base packages in devcontainer

* --no-cache-dir
This commit is contained in:
Oliver
2023-12-05 07:05:48 +11:00
committed by GitHub
parent 15f58b965e
commit f96055a33f
6 changed files with 50 additions and 80 deletions

View File

@@ -3,16 +3,12 @@
{
"name": "InvenTree",
"build": {
"dockerfile": "Dockerfile",
"dockerfile": "../Dockerfile",
"context": "..",
"target": "devcontainer",
"args": {
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"VARIANT": "3.10-bullseye",
// Options
"NODE_VERSION": "lts/*",
"WORKSPACE": "${containerWorkspaceFolder}"
"base_image": "mcr.microsoft.com/vscode/devcontainers/base:alpine-3.18",
"workspace": "${containerWorkspaceFolder}"
}
},
@@ -48,8 +44,11 @@
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8000],
"forwardPorts": [5173, 8000],
"portsAttributes": {
"5173": {
"label": "Vite server"
},
"8000": {
"label": "InvenTree server"
}
@@ -60,9 +59,9 @@
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"containerUser": "vscode",
"features": {
"git": "os-provided",
"github-cli": "latest"
"git": "os-provided"
},
"remoteEnv": {