fleetdm / fleet

Open-source platform for IT, security, and infrastructure teams. (Linux, macOS, Chrome, Windows, cloud, data center)
https://fleetdm.com
Other
3.15k stars 431 forks source link

Add a devcontainer (working example provided) #24067

Open nicolaspernoud opened 9 hours ago

nicolaspernoud commented 9 hours ago

Hello,

In order to quickstart fleet development and not mess with the computer nodejs version, the following devcontainer seems to work well. In case you'd like to add it to the project (which is amazing by the way) :

{
    "name": "Docker in Docker for fleet development",
    "image": "mcr.microsoft.com/devcontainers/base:latest",
    "features": {
        "ghcr.io/devcontainers/features/docker-in-docker:2": {
            "version": "latest",
            "enableNonRootDocker": "true",
            "moby": "true"
        },
        "ghcr.io/devcontainers/features/go:1": {
            "version": "latest"
        },
        "ghcr.io/devcontainers/features/node:1": {
            "nodeGypDependencies": true,
            "installYarnUsingApt": true,
            "version": "20.11.1",
            "pnpmVersion": "latest",
            "nvmVersion": "latest"
        }
    },
    "runArgs": [
        "--init"
    ],
    "forwardPorts": [
        8080
    ],
    "postCreateCommand": "echo 'To get started : use the command `./build/fleet prepare db --dev` in a new terminal and Run `fleet serve` in VS Code debug panel !'"
}

Best regards,