From a527abe4a64ff9e024b3a5627a62a1bf400c8996 Mon Sep 17 00:00:00 2001 From: Entity Date: Mon, 14 Oct 2024 12:51:58 +0200 Subject: [PATCH] Initial Devcontainer configuration --- .devcontainer/Dev.Dockerfile | 16 ++++++++++++++++ .devcontainer/devcontainer.json | 26 ++++++++++++++++++++++++++ .devcontainer/docker-compose.yaml | 22 ++++++++++++++++++++++ .env | 1 + 4 files changed, 65 insertions(+) create mode 100644 .devcontainer/Dev.Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/docker-compose.yaml create mode 100644 .env diff --git a/.devcontainer/Dev.Dockerfile b/.devcontainer/Dev.Dockerfile new file mode 100644 index 0000000..d8d8fad --- /dev/null +++ b/.devcontainer/Dev.Dockerfile @@ -0,0 +1,16 @@ +FROM alpine:latest +# Install dependencies +RUN apk add --no-cache --update git ca-certificates curl openssh-client +# Add my user +RUN adduser Entity -h /home/Entity -S +RUN addgroup Entity +RUN adduser Entity Entity +# Switch to my user +USER Entity +# Install Rust +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y +# Configure git to use my name, email and signing keys +RUN git config --global user.name Entity +RUN git config --global user.email entity@runeterra.be +RUN git config --global gpg.format ssh +RUN git config --global user.signingkey /home/Entity/.ssh/git.runeterra.be \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f2260f2 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,26 @@ +{ + "name": "SSH-Transfer", + "dockerComposeFile": "./docker-compose.yaml", + "service": "Dev", + "workspaceFolder": "/App", + "remoteUser": "Entity", + "overrideCommand": true, + "shutdownAction": "stopCompose", + "customizations": { + "vscode": { + "extensions": [ + "aaron-bond.better-comments", + "mikestead.dotenv", + "VisualStudioExptTeam.vscodeintellicode", + "christian-kohler.path-intellisense", + "ms-vscode-remote.remote-ssh", + "vscode-icons-team.vscode-icons", + "redhat.vscode-xml", + "redhat.vscode-yaml", + "rust-lang.rust-analyzer", + "dustypomerleau.rust-syntax", + "tamasfe.even-better-toml" + ] + } + } +} \ No newline at end of file diff --git a/.devcontainer/docker-compose.yaml b/.devcontainer/docker-compose.yaml new file mode 100644 index 0000000..4cf5580 --- /dev/null +++ b/.devcontainer/docker-compose.yaml @@ -0,0 +1,22 @@ +services: + Dev: + container_name: "SSH-Transfer-Dev" + build: + context: . + dockerfile: "./Dev.Dockerfile" + image: "ssh-transfer:dev-latest" + networks: + - SSH-Transfer + volumes: + - "../:/App:rw" + - Docker-SSH:/ssh:ro + +volumes: + Docker-SSH: + external: true + name: "Docker-SSH" + +networks: + SSH-Transfer: + external: false + name: "SSH-Transfer" \ No newline at end of file diff --git a/.env b/.env new file mode 100644 index 0000000..ff92e56 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +COMPOSE_PROJECT_NAME=SSH-Transfer \ No newline at end of file