From 7522f4dac95ad1c39ab9571225cc3640e0e7eab0 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 02:27:44 +0000 Subject: [PATCH] feat: add devcontainer setup with bun, docker-in-docker, and auto env copy Co-authored-by: jasonspriggs <16108587+jasonspriggs@users.noreply.github.com> --- .devcontainer/devcontainer.json | 34 +++++++++++++++++++++++++++++++++ .devcontainer/setup.sh | 26 +++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/setup.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..64987aeb8 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,34 @@ +{ + "name": "Comp AI", + "image": "mcr.microsoft.com/devcontainers/javascript-node:20", + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": {} + }, + "forwardPorts": [3000, 3002, 5432], + "portsAttributes": { + "3000": { + "label": "App", + "onAutoForward": "notify" + }, + "3002": { + "label": "Portal", + "onAutoForward": "notify" + }, + "5432": { + "label": "Postgres", + "onAutoForward": "silent" + } + }, + "customizations": { + "vscode": { + "extensions": [ + "esbenp.prettier-vscode", + "bradlc.vscode-tailwindcss", + "Prisma.prisma", + "oven.bun-vscode" + ] + } + }, + "postCreateCommand": "bash .devcontainer/setup.sh", + "remoteUser": "node" +} \ No newline at end of file diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100755 index 000000000..930fb9204 --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,26 @@ +#!/bin/bash +set -e + +echo "Installing Bun..." +npm install -g bun + +echo "Copying .env files..." +if [ ! -f apps/app/.env ] && [ -f apps/app/.env.example ]; then + cp apps/app/.env.example apps/app/.env + echo "Copied apps/app/.env" +fi + +if [ ! -f apps/portal/.env ] && [ -f apps/portal/.env.example ]; then + cp apps/portal/.env.example apps/portal/.env + echo "Copied apps/portal/.env" +fi + +if [ ! -f packages/db/.env ] && [ -f packages/db/.env.example ]; then + cp packages/db/.env.example packages/db/.env + echo "Copied packages/db/.env" +fi + +echo "Installing project dependencies..." +bun install + +echo "Setup complete!"