{
  "name": "Homelab Development Environment",
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04",

  "features": {
    "ghcr.io/devcontainers/features/docker-in-docker:2": {
      "version": "latest",
      "enableNonRootDocker": "true"
    },
    "ghcr.io/devcontainers/features/python:1": {
      "version": "3.11"
    },
    "ghcr.io/devcontainers/features/git:1": {
      "version": "latest"
    },
    "ghcr.io/devcontainers/features/common-utils:2": {
      "installZsh": true,
      "configureZshAsDefaultShell": true,
      "installOhMyZsh": true
    }
  },

  "customizations": {
    "vscode": {
      "extensions": [
        "ms-python.python",
        "ms-python.pylint",
        "redhat.vscode-yaml",
        "ms-vscode.vscode-docker",
        "ms-vscode-remote.remote-containers",
        "redhat.ansible",
        "timonwong.shellcheck",
        "foxundermoon.shell-format"
      ],
      "settings": {
        "python.defaultInterpreterPath": "/usr/local/bin/python",
        "yaml.schemas": {
          "https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json": [
            "docker-compose*.yml",
            "docker-compose*.yaml",
            "compose*.yml",
            "compose*.yaml"
          ]
        },
        "yaml.validate": true,
        "yaml.format.enable": true,
        "files.associations": {
          "*.yml": "yaml",
          "*.yaml": "yaml"
        }
      }
    }
  },

  "postCreateCommand": "pip install -r requirements.txt && pre-commit install",

  "remoteUser": "vscode",

  "mounts": [
    "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
  ],

  "forwardPorts": [
    3000,
    8080,
    9090
  ],

  "portsAttributes": {
    "3000": {
      "label": "Development Server"
    },
    "8080": {
      "label": "Test Service"
    },
    "9090": {
      "label": "Monitoring"
    }
  }
}
