From ebc651c715c268161956840a494713e0559a9994 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Sat, 6 Dec 2025 11:01:30 +0000 Subject: [PATCH] one repo to rule them all --- .devcontainer/Dockerfile | 47 ++++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 37 +++++++++++++++++++++++++ .devcontainer/docker-compose.yml | 11 ++++++++ .devcontainer/post-install.sh | 1 + .vscode/settings.json | 19 +++++++++++++ 5 files changed, 115 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/docker-compose.yml create mode 100644 .devcontainer/post-install.sh create mode 100644 .vscode/settings.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..239f14b --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,47 @@ +FROM library/python:3.12-bullseye + +ARG USER=vscode +ARG DEBIAN_FRONTEND=noninteractive + +# Install system dependencies in a single layer +RUN apt update && apt install -y --no-install-recommends \ + sudo jq vim curl\ + && apt autoremove -y \ + && rm -rf /var/lib/apt/lists/* + +# Create the user and grant sudo privileges +RUN useradd -m -s /bin/bash ${USER} \ + && echo "${USER} ALL=(ALL) NOPASSWD: ALL" >/etc/sudoers.d/${USER} \ + && chmod 0440 /etc/sudoers.d/${USER} + +# Install Poetry +RUN pip install --no-cache-dir poetry + + +# Install Node.js 22 (from NodeSource) +RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ + && apt install -y nodejs \ + && node -v \ + && npm -v + + +# # Install aws +# RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" +# RUN unzip awscliv2.zip +# RUN ./aws/install + +# # Install terraform +# RUN apt-get update && sudo apt-get install -y gnupg software-properties-common +# RUN wget -O- https://apt.releases.hashicorp.com/gpg | \ +# gpg --dearmor | \ +# sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg > /dev/null +# RUN echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \ +# https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \ +# tee /etc/apt/sources.list.d/hashicorp.list +# RUN apt update +# RUN apt-get install terraform +# RUN terraform -install-autocomplete + + +# Set the working directory +WORKDIR /workspaces/one_repo_to_rule_them_all \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..c78c2ca --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,37 @@ +{ + "name": "Basic Python", + "dockerComposeFile": "docker-compose.yml", + "service": "one_repo_to_rule_them_all", + "remoteUser": "vscode", + "workspaceFolder": "/workspaces/one_repo_to_rule_them_all", + "postStartCommand": "bash .devcontainer/post-install.sh", + + "features": { + // "ghcr.io/devcontainers/features/ssh-agent:1": {} + }, + + "mounts": [ + // Optional convenience mount + "source=${localEnv:HOME},target=/workspaces/home,type=bind" + ], + + "customizations": { + "vscode": { + "settings": { + "files.defaultWorkspace": "/workspaces/one_repo_to_rule_them_all" + }, + "extensions": [ + "ms-python.python", + "ms-toolsai.jupyter", + "mechatroner.rainbow-csv", + "ms-toolsai.datawrangler", + "lindacong.vscode-book-reader", + "4ops.terraform", + "fabiospampinato.vscode-todo-plus", + "jgclark.vscode-todo-highlight", + "corentinartaud.pdfpreview" + ] + } + } +} + diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000..d52b733 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,11 @@ +version: '3.8' + +services: + one_repo_to_rule_them_all: + user: "${UID}:${GID}" + build: + context: .. + dockerfile: .devcontainer/Dockerfile + command: sleep infinity + volumes: + - ..:/workspaces/one_repo_to_rule_them_all diff --git a/.devcontainer/post-install.sh b/.devcontainer/post-install.sh new file mode 100644 index 0000000..68ef990 --- /dev/null +++ b/.devcontainer/post-install.sh @@ -0,0 +1 @@ +# Place holder \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..27782c1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,19 @@ +{ + "jupyter.interactiveWindow.textEditor.executeSelection": true, + "python.REPL.sendToNativeREPL": true, + "notebook.output.scrolling": true, + "terminal.integrated.defaultProfile.linux": "bash", + "editor.rulers": [67], + "terminal.integrated.profiles.linux": { + "bash": { + "path": "/bin/bash" + } + }, + + // Hot reload setting that needs to be in user settings + // "jupyter.runStartupCommands": [ + // "%load_ext autoreload", "%autoreload 2" + // ] + + +} \ No newline at end of file