Skip to content

Commit

Permalink
add vscode devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasvargiu committed May 3, 2024
1 parent 3430f6b commit ede7487
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose
{
"name": "oref0",
"dockerComposeFile": [
"../docker-compose.yml",
"../docker-compose.override.yml",
"docker-compose.yml"
],
"service": "node",
"workspaceFolder": "/app",
"features": {},
"customizations": {
"vscode": {
"extensions": [
"Orta.vscode-jest",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"rvest.vs-code-prettier-eslint"
]
}
}
}
24 changes: 24 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
services:
# Update this to the name of the service you want to work with in your docker-compose.yml file
node:
# Uncomment if you want to override the service's Dockerfile to one in the .devcontainer
# folder. Note that the path of the Dockerfile and context is relative to the *primary*
# docker-compose.yml file (the first in the devcontainer.json "dockerComposeFile"
# array). The sample below assumes your primary file is in the root of your project.
#
# build:
# context: .
# dockerfile: .devcontainer/Dockerfile

# volumes:
# Update this to wherever you want VS Code to mount the folder of your project
# - ..:/workspaces:cached

# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
# cap_add:
# - SYS_PTRACE
# security_opt:
# - seccomp:unconfined

# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ package-lock.json
*.pyc

bash-unit-test-temp

docker-compose.override.yml
2 changes: 2 additions & 0 deletions docker-compose.override.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
services:
node: {}
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
node:
build:
context: ./docker/node
working_dir: '/app'
volumes:
- ./:/app
6 changes: 6 additions & 0 deletions docker/node/.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="robbyrussell"
zstyle ':omz:update' mode disabled
plugins=(git)

source $ZSH/oh-my-zsh.sh
7 changes: 7 additions & 0 deletions docker/node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ARG NODE_VERSION="20-slim"
FROM node:${NODE_VERSION}
RUN apt update -y && apt install -y openssh-client curl zsh git vim make jq python3
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" \
&& chsh -s $(which zsh)
COPY .zshrc /root/.zshrc
RUN corepack enable

0 comments on commit ede7487

Please sign in to comment.