diff --git a/.devcontainer/.npm/.gitkeep b/.devcontainer/.npm/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..c2f18352f8 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,21 @@ +{ + "name": "UI devcontainer", + "dockerComposeFile": "docker-compose.yml", + "service": "repo", + "containerUser": "root", + "workspaceFolder": "/workspace", + "shutdownAction": "stopCompose", + "features": { + "ghcr.io/devcontainers-extra/features/apt-packages:1": { + "packages": "libgtk2.0-0,libgtk-3-0,libgbm-dev,libnotify-dev,libnss3,libxss1,libasound2,libxtst6,xauth,xvfb" + } + }, + "postCreateCommand": "npm update --global npm && npm install && npm --prefix ./client install && npm --prefix ./server install && npm --prefix ./tests install && npx --prefix ./tests cypress install", + "customizations": { + "vscode": { + "extensions": [ + "esbenp.prettier-vscode" + ] + } + } +} \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000000..297a73df0a --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,9 @@ +services: + repo: + image: "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm" + volumes: + - ../:/workspace:cached + - .npm:/home/node/.npm:delegated + entrypoint: sleep infinity + environment: + VITE_HOST: "0.0.0.0" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5ace4600a1..1ab3ef225f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,3 +4,7 @@ updates: directory: "/" schedule: interval: "weekly" + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/client/vite.config.ts b/client/vite.config.ts index 5c5783ca97..9620545245 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -1,5 +1,6 @@ import eslintPlugin from "@nabla/vite-plugin-eslint"; import react from "@vitejs/plugin-react"; +import { env } from "node:process"; import { resolve } from "path"; import { defineConfig } from "vite"; @@ -11,6 +12,7 @@ export default defineConfig({ }, server: { allowedHosts: [".dev.renku.ch"], + ...(env.VITE_HOST ? { host: env.VITE_HOST } : {}), }, plugins: [react({ include: "/index.html" }), eslintPlugin()], resolve: {