36
.devcontainer/Dockerfile
Normal file
36
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
||||
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 lazygit
|
||||
RUN LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*') \
|
||||
&& curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz" \
|
||||
&& tar xf lazygit.tar.gz lazygit \
|
||||
&& install lazygit /usr/local/bin \
|
||||
&& rm lazygit.tar.gz lazygit
|
||||
|
||||
# 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
|
||||
25
.devcontainer/devcontainer.json
Normal file
25
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "Monorepo - Bun + React",
|
||||
"build": {
|
||||
"context": ".",
|
||||
"dockerfile": "Dockerfile"
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"biomejs.biome",
|
||||
"oven.bun-vscode"
|
||||
],
|
||||
"settings": {
|
||||
"editor.defaultFormatter": "biomejs.biome",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"quickfix.biome": "explicit",
|
||||
"source.organizeImports.biome": "explicit"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"forwardPorts": [3000, 5173],
|
||||
"postCreateCommand": "bun install && ./scripts/setup-git.sh"
|
||||
}
|
||||
Reference in New Issue
Block a user