Skip to content

Commit

Permalink
feat: Configure docker dev env with zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
argentinaluiz committed Mar 10, 2022
1 parent fc48e07 commit 1c3cec2
Show file tree
Hide file tree
Showing 8 changed files with 1,691 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
// https://github.com/microsoft/vscode-dev-containers/tree/v0.217.4/containers/docker-existing-docker-compose
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
{
"name": "micro-videos-typescript",
"name": "micro-videos-typescript-test",

// Update the 'dockerComposeFile' list if you have more compose files or use different names.
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
"dockerComposeFile": [
"../docker-compose.yaml",
"../docker-compose.override.yaml",
"docker-compose.yml"
],

Expand All @@ -21,8 +22,7 @@

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.shell.linux": "/bin/bash",
"terminal.integrated.defaultProfile.linux": "zsh",
},

// Add the IDs of extensions you want installed when the container is created.
Expand Down
Empty file added .docker/zsh/history/.gitkeep
Empty file.
1,628 changes: 1,628 additions & 0 deletions .docker/zsh/powerlevel10k/.p10k.zsh

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules/
.history/
.history/
.docker/zsh/history/.zsh_history
tsconfig.tsbuildinfo
18 changes: 18 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"peacock.remoteColor": "#215732",
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#2f7c47",
"activityBar.activeBorder": "#422c74",
"activityBar.background": "#2f7c47",
"activityBar.foreground": "#e7e7e7",
"activityBar.inactiveForeground": "#e7e7e799",
"activityBarBadge.background": "#422c74",
"activityBarBadge.foreground": "#e7e7e7",
"sash.hoverBorder": "#2f7c47",
"tab.activeBorder": "#2f7c47",
"titleBar.activeBackground": "#2f7c47",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#2f7c4799",
"titleBar.inactiveForeground": "#e7e7e799"
}
}
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
FROM node:14.15.4-slim

RUN mkdir -p /usr/share/man/man1 && \
echo 'deb http://ftp.debian.org/debian stretch-backports main' | tee /etc/apt/sources.list.d/stretch-backports.list && \
apt update && apt install -y --no-install-recommends \
openjdk-11-jre \
git \
zsh \
curl \
wget \
fonts-powerline

USER node

WORKDIR /home/node/app

ENV JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"

RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.1.2/zsh-in-docker.sh)" -- \
-t https://github.com/romkatv/powerlevel10k \
-p git \
-p git-flow \
-p https://github.com/zdharma-continuum/fast-syntax-highlighting \
-p https://github.com/zsh-users/zsh-autosuggestions \
-p https://github.com/zsh-users/zsh-completions \
-a 'export TERM=xterm-256color'

RUN echo '[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh' >> ~/.zshrc && \
echo 'HISTFILE=/home/node/zsh/.zsh_history' >> ~/.zshrc


CMD [ ".docker/entrypoint.sh" ]
13 changes: 13 additions & 0 deletions docker-compose.override.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3'

services:
app:
volumes:
- ./.docker/zsh/powerlevel10k/.p10k.zsh:/home/node/.p10k.zsh:delegated
- ./.docker/zsh/history:/home/node/zsh:delegated

# multiple docker-compose

# sync

#history local
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
app:
build: .
command: .docker/entrypoint.sh
container_name: micro-videos-app-without-nest-typescript
container_name: micro-videos-typescript-test-app
tty: true
ports:
- 3000:3000
Expand Down

0 comments on commit 1c3cec2

Please sign in to comment.