Skip to content

Commit

Permalink
Merge pull request #12 from yorkblansh/chore/template_sync_0a817b8
Browse files Browse the repository at this point in the history
update from devcontainer-template
  • Loading branch information
yorkblansh authored Jan 17, 2024
2 parents 9f82b0c + 06d6e2b commit 5c11d48
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 57 deletions.
71 changes: 39 additions & 32 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,39 @@
FROM node:20

RUN apt-get update && apt-get install fish vim curl sudo tmux -y && \
echo "fish" >>~/.bashrc

RUN echo 'root:123' | chpasswd
RUN echo 'node:123' | chpasswd

RUN npm i -g npm
RUN npm i -g npm-check-updates

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 .

RUN echo "fish" >>~/.bashrc
RUN mkdir -p ~/.config/fish
RUN echo "alias tmux='tmux -2'" >>~/.config/fish/config.fish
RUN echo "set -g default-terminal 'xterm-256color' \n set-option -ga terminal-overrides ',xterm-256color:Tc'" >>~/.tmux.conf

WORKDIR /app

ENV PORT=5055

EXPOSE 5055

FROM node:20

RUN apt-get update && apt-get install fish vim curl sudo tmux -y && \
echo "fish" >>~/.bashrc

RUN echo 'root:123' | chpasswd
RUN echo 'node:123' | chpasswd

RUN npm i -g npm npm-check-updates bun

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 .

RUN echo "fish" >>~/.bashrc
RUN mkdir -p ~/.config/fish
RUN echo "alias tmux='tmux -2'" >>~/.config/fish/config.fish
RUN echo "set -g default-terminal 'xterm-256color' \n set-option -ga terminal-overrides ',xterm-256color:Tc'" >>~/.tmux.conf

# 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

ENV PORT=5055

EXPOSE 5055

44 changes: 19 additions & 25 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
version: '3.8'

services:
node-20:
image: node:20

api:
extra_hosts:
- 'host.docker.internal:host-gateway'
# network_mode: "host"
container_name: api-dev
build:
context: ./
dockerfile: ./Dockerfile
ports:
- 85:5055
- 86:5056
- 5172:5172
# - 1401:1401
- 1420:1420
volumes:
- ./:/app
tty: true
stdin_open: true
restart: on-failure
services:
node-20:
image: node:20

app:
extra_hosts:
- 'host.docker.internal:host-gateway'
container_name: app
build:
context: ./
dockerfile: ./Dockerfile
ports:
- 90:5055
- 5174:5172
volumes:
- ./:/app
tty: true
stdin_open: true
restart: on-failure
5 changes: 5 additions & 0 deletions install-lazygit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
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/
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/
echo "alias lazygit='~/.lazygit/lazygit'" >> ~/.config/fish/config.fish
echo "alias lz='~/.lazygit/lazygit'" >> ~/.config/fish/config.fish
source ~/.config/fish/config.fish

0 comments on commit 5c11d48

Please sign in to comment.