diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..7557761 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,35 @@ +# Base image +ARG VARIANT=bookworm-slim +FROM debian:${VARIANT} +ENV DEBIAN_FRONTEND=noninteractive +ENV LC_ALL=C.UTF-8 +ENV LANG=C.UTF-8 + +# Arguments +ARG CONTAINER_USER=esp +ARG CONTAINER_GROUP=esp + +# Install dependencies +RUN apt-get update \ + && apt-get install -y git curl build-essential \ + libudev-dev librust-libudev-sys-dev pkg-config + +# Set users +RUN adduser --disabled-password --gecos "" ${CONTAINER_USER} +USER ${CONTAINER_USER} +WORKDIR /home/${CONTAINER_USER} + +# Install rustup +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ + --default-toolchain none -y --profile minimal + +# Update envs +ENV PATH=${PATH}:/home/${CONTAINER_USER}/.cargo/bin + +# Set default toolchain +RUN rustup default stable +RUN rustup component add rustfmt + +EXPOSE 8000 + +CMD [ "/bin/bash" ] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..949e876 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,30 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/debian +{ + "name": "esp_web_flash_server", + "build": { + "dockerfile": "Dockerfile", + "args": { + "CONTAINER_USER": "esp", + "CONTAINER_GROUP": "esp", + "ESP_BOARD": "esp32s3" + } + }, + "forwardPorts": [ + 8000 + ], + "workspaceMount": "source=${localWorkspaceFolder},target=/home/esp/esp_web_flash_server,type=bind,consistency=cached", + "workspaceFolder": "/home/esp/esp_web_flash_server", + "mounts": [ + "source=${localEnv:HOME}/.ssh,target=/home/esp/.ssh,type=bind,consistency=cached" + ], + "customizations": { + "vscode": { + "extensions": [ + "rust-lang.rust-analyzer", + "tamasfe.even-better-toml", + "fill-labs.dependi" + ] + } + } +} \ No newline at end of file