You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

211 lines
7.3 KiB

11 months ago
  1. // For format details, see https://aka.ms/devcontainer.json. For config options, see the
  2. // README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
  3. {
  4. "name": "Node.js",
  5. // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
  6. // "build": {
  7. // "args": {
  8. // "ARG_UID": "1000",
  9. // "ARG_GID": "1000"
  10. // },
  11. // "dockerfile": "Dockerfile"
  12. // },
  13. // "containerUser": "anythingllm",
  14. // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
  15. "image": "mcr.microsoft.com/devcontainers/javascript-node:1-18-bookworm",
  16. // Features to add to the dev container. More info: https://containers.dev/features.
  17. "features": {
  18. // Docker very useful linter
  19. "ghcr.io/dhoeric/features/hadolint:1": {
  20. "version": "latest"
  21. },
  22. // Terraform support
  23. "ghcr.io/devcontainers/features/terraform:1": {},
  24. // Just a wrap to install needed packages
  25. "ghcr.io/devcontainers-contrib/features/apt-packages:1": {
  26. // Dependencies copied from ../docker/Dockerfile plus some dev stuff
  27. "packages": [
  28. "build-essential",
  29. "ca-certificates",
  30. "curl",
  31. "ffmpeg",
  32. "fonts-liberation",
  33. "git",
  34. "gnupg",
  35. "htop",
  36. "less",
  37. "libappindicator1",
  38. "libasound2",
  39. "libatk-bridge2.0-0",
  40. "libatk1.0-0",
  41. "libc6",
  42. "libcairo2",
  43. "libcups2",
  44. "libdbus-1-3",
  45. "libexpat1",
  46. "libfontconfig1",
  47. "libgbm1",
  48. "libgcc1",
  49. "libgfortran5",
  50. "libglib2.0-0",
  51. "libgtk-3-0",
  52. "libnspr4",
  53. "libnss3",
  54. "libpango-1.0-0",
  55. "libpangocairo-1.0-0",
  56. "libstdc++6",
  57. "libx11-6",
  58. "libx11-xcb1",
  59. "libxcb1",
  60. "libxcomposite1",
  61. "libxcursor1",
  62. "libxdamage1",
  63. "libxext6",
  64. "libxfixes3",
  65. "libxi6",
  66. "libxrandr2",
  67. "libxrender1",
  68. "libxss1",
  69. "libxtst6",
  70. "locales",
  71. "lsb-release",
  72. "procps",
  73. "tzdata",
  74. "wget",
  75. "xdg-utils"
  76. ]
  77. }
  78. },
  79. "updateContentCommand": "cd server && yarn && cd ../collector && PUPPETEER_DOWNLOAD_BASE_URL=https://storage.googleapis.com/chrome-for-testing-public yarn && cd ../frontend && yarn && cd .. && yarn setup:envs && yarn prisma:setup && echo \"Please run yarn dev:server, yarn dev:collector, and yarn dev:frontend in separate terminal tabs.\"",
  80. // Use 'postCreateCommand' to run commands after the container is created.
  81. // This configures VITE for github codespaces and installs gh cli
  82. "postCreateCommand": "if [ \"${CODESPACES}\" = \"true\" ]; then echo 'VITE_API_BASE=\"https://$CODESPACE_NAME-3001.$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN/api\"' > ./frontend/.env && (type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) && sudo mkdir -p -m 755 /etc/apt/keyrings && wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg && echo \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null && sudo apt update && sudo apt install gh -y; fi",
  83. "portsAttributes": {
  84. "3001": {
  85. "label": "Backend",
  86. "onAutoForward": "notify"
  87. },
  88. "3000": {
  89. "label": "Frontend",
  90. "onAutoForward": "openPreview"
  91. }
  92. },
  93. "capAdd": [
  94. "SYS_ADMIN" // needed for puppeteer using headless chrome in sandbox
  95. ],
  96. "remoteEnv": {
  97. "NODE_ENV": "development",
  98. "ESLINT_USE_FLAT_CONFIG": "true",
  99. "ANYTHING_LLM_RUNTIME": "docker"
  100. },
  101. // "initializeCommand": "echo Initialize....",
  102. "shutdownAction": "stopContainer",
  103. // Configure tool-specific properties.
  104. "customizations": {
  105. "codespaces": {
  106. "openFiles": [
  107. "README.md",
  108. ".devcontainer/README.md"
  109. ]
  110. },
  111. "vscode": {
  112. "openFiles": [
  113. "README.md",
  114. ".devcontainer/README.md"
  115. ],
  116. "extensions": [
  117. "bierner.github-markdown-preview",
  118. "bradlc.vscode-tailwindcss",
  119. "dbaeumer.vscode-eslint",
  120. "editorconfig.editorconfig",
  121. "esbenp.prettier-vscode",
  122. "exiasr.hadolint",
  123. "flowtype.flow-for-vscode",
  124. "gamunu.vscode-yarn",
  125. "hashicorp.terraform",
  126. "mariusschulz.yarn-lock-syntax",
  127. "ms-azuretools.vscode-docker",
  128. "streetsidesoftware.code-spell-checker",
  129. "actboy168.tasks",
  130. "tombonnike.vscode-status-bar-format-toggle",
  131. "ms-vscode.js-debug"
  132. ],
  133. "settings": {
  134. "[css]": {
  135. "editor.defaultFormatter": "esbenp.prettier-vscode"
  136. },
  137. "[dockercompose]": {
  138. "editor.defaultFormatter": "esbenp.prettier-vscode"
  139. },
  140. "[dockerfile]": {
  141. "editor.defaultFormatter": "ms-azuretools.vscode-docker"
  142. },
  143. "[html]": {
  144. "editor.defaultFormatter": "esbenp.prettier-vscode"
  145. },
  146. "[javascript]": {
  147. "editor.defaultFormatter": "esbenp.prettier-vscode"
  148. },
  149. "[javascriptreact]": {
  150. "editor.defaultFormatter": "esbenp.prettier-vscode"
  151. },
  152. "[json]": {
  153. "editor.defaultFormatter": "esbenp.prettier-vscode"
  154. },
  155. "[jsonc]": {
  156. "editor.defaultFormatter": "esbenp.prettier-vscode"
  157. },
  158. "[markdown]": {
  159. "editor.defaultFormatter": "esbenp.prettier-vscode"
  160. },
  161. "[postcss]": {
  162. "editor.defaultFormatter": "esbenp.prettier-vscode"
  163. },
  164. "[toml]": {
  165. "editor.defaultFormatter": "tamasfe.even-better-toml"
  166. },
  167. "eslint.debug": true,
  168. "eslint.enable": true,
  169. "eslint.experimental.useFlatConfig": true,
  170. "eslint.run": "onSave",
  171. "files.associations": {
  172. ".*ignore": "ignore",
  173. ".editorconfig": "editorconfig",
  174. ".env*": "properties",
  175. ".flowconfig": "ini",
  176. ".prettierrc": "json",
  177. "*.css": "tailwindcss",
  178. "*.md": "markdown",
  179. "*.sh": "shellscript",
  180. "docker-compose.*": "dockercompose",
  181. "Dockerfile*": "dockerfile",
  182. "yarn.lock": "yarnlock"
  183. },
  184. "javascript.format.enable": false,
  185. "javascript.inlayHints.enumMemberValues.enabled": true,
  186. "javascript.inlayHints.functionLikeReturnTypes.enabled": true,
  187. "javascript.inlayHints.parameterTypes.enabled": true,
  188. "javascript.inlayHints.variableTypes.enabled": true,
  189. "js/ts.implicitProjectConfig.module": "CommonJS",
  190. "json.format.enable": false,
  191. "json.schemaDownload.enable": true,
  192. "npm.autoDetect": "on",
  193. "npm.packageManager": "yarn",
  194. "prettier.useEditorConfig": false,
  195. "tailwindCSS.files.exclude": [
  196. "**/.git/**",
  197. "**/node_modules/**",
  198. "**/.hg/**",
  199. "**/.svn/**",
  200. "**/dist/**"
  201. ],
  202. "typescript.validate.enable": false,
  203. "workbench.editorAssociations": {
  204. "*.md": "vscode.markdown.preview.editor"
  205. }
  206. }
  207. }
  208. }
  209. // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
  210. // "remoteUser": "root"
  211. }