diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..55c484fb65 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,7 @@ +{ + "name": "Adguard", + "dockerComposeFile": "../docker-compose.yaml", + "service": "adguard", + "workspaceFolder": "/adguard/${localWorkspaceFolderBasename}", + "remoteUser": "node" +} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..285b8c5539 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +FROM node:18 + +RUN apt-get update && apt-get install fish mc vim curl sudo tmux -y && \ + echo "fish" >>~/.bashrc + +RUN echo 'root:123' | chpasswd +RUN echo 'node:123' | chpasswd + +RUN sudo usermod -a -G sudo node + +USER node + +# customize tmux +RUN cd && \ + git clone https://github.com/gpakosz/.tmux.git && \ + ln -s -f .tmux/.tmux.conf && \ + cp .tmux/.tmux.conf.local . + +# upd configs for cli tools +RUN echo "fish" >>~/.bashrc +RUN mkdir -p ~/.config/fish +RUN echo "alias tmux='tmux -2'" >>~/.config/fish/config.fish +RUN echo "set -U fish_prompt_pwd_dir_length 0" >>~/.config/fish/config.fish + +# install lazygit +RUN wget https://github.com/jesseduffield/lazygit/releases/download/v$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')/lazygit_$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')_Linux_32-bit.tar.gz -P ~/.lazygit/ +RUN tar -xf ~/.lazygit/lazygit_$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')_Linux_32-bit.tar.gz -C ~/.lazygit/ +RUN echo "alias lazygit='~/.lazygit/lazygit'" >>~/.config/fish/config.fish +RUN echo "alias lz='~/.lazygit/lazygit'" >>~/.config/fish/config.fish +RUN git config --global core.autocrlf true +RUN git config --global --add safe.directory '*' + +WORKDIR /app + diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000000..a24cb5aad2 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,17 @@ +version: "3.1" + +services: + adguard: + extra_hosts: + - "host.docker.internal:host-gateway" + container_name: adguard + build: + context: ./ + dockerfile: ./Dockerfile + volumes: + - ..:/adguard:cached + tty: true + stdin_open: true + restart: on-failure + command: sleep infinity + \ No newline at end of file