Skip to content

Commit

Permalink
add devconatiner stuff
Browse files Browse the repository at this point in the history
add lazygit for devconatiner

remove expose ports from dockerfile
  • Loading branch information
yorkblansh committed Oct 2, 2024
1 parent e3544a7 commit 3f53357
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "Adguard",
"dockerComposeFile": "../docker-compose.yaml",
"service": "adguard",
"workspaceFolder": "/adguard/${localWorkspaceFolderBasename}",
"remoteUser": "node"
}
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

17 changes: 17 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3f53357

Please sign in to comment.