From 6e034108fc9f32aa26d95863760a9591a005b10b Mon Sep 17 00:00:00 2001 From: Kenneth Date: Sat, 13 Sep 2025 22:59:23 +0000 Subject: [PATCH] chore: create dev env docker image Co-authored-by: Ona --- .devcontainer/Dockerfile | 32 ++++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 7 +++++-- 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..c348805 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,32 @@ +FROM mcr.microsoft.com/devcontainers/javascript-node:24 + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + curl \ + ca-certificates \ + gnupg \ + lsb-release \ + && rm -rf /var/lib/apt/lists/* + +# Install Tailscale +RUN curl -fsSL https://tailscale.com/install.sh | sh + +# Install Bun as the node user +USER node +RUN curl -fsSL https://bun.sh/install | bash +ENV PATH="/home/node/.bun/bin:$PATH" + +# Switch back to root for any remaining setup +USER root + +# Ensure the node user owns their home directory +RUN chown -R node:node /home/node + +# Set the default user back to node +USER node + +# Set working directory +WORKDIR /workspace + +# Verify installations +RUN bun --version && tailscale version \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 56983ce..b828298 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,9 @@ { "name": "React + Bun + Convex Development", - "image": "mcr.microsoft.com/devcontainers/javascript-node:24", + "build": { + "context": ".", + "dockerfile": "Dockerfile" + }, "features": { "ghcr.io/devcontainers/features/git:1": {}, "ghcr.io/devcontainers/features/github-cli:1": {}, @@ -8,7 +11,7 @@ "moby": false } }, - "postCreateCommand": "curl -fsSL https://bun.sh/install | bash && source ~/.bashrc && bun install", + "postCreateCommand": "bun install", "customizations": { "vscode": { "extensions": [