Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Worker Threads, cleanup, caching, more. #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "API Container",
"name": "TS-ESNode Container",
"dockerFile": "./Dockerfile.dev",
"settings": {
// This dev container does include /bin/bash if you prefer to use it instead of ash.
Expand All @@ -10,7 +10,11 @@
"SHELL": "/bin/sh"
},

"extensions": ["esbenp.prettier-vscode"],
"extensions": [
"esbenp.prettier-vscode",
"gruntfuggly.todo-tree",
"dbaeumer.vscode-eslint"
],
"remoteUser": "node",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
"workspaceFolder": "/workspace",
Expand Down
17 changes: 3 additions & 14 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@

FROM mhart/alpine-node:13
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
# will be updated to match your local UID/GID (when using the dockerFile property).
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=node
ARG USER_UID=1000
ARG USER_GID=$USER_UID
FROM node:alpine3.11

# Install Shadow non busybox for better user management & support
RUN apk add --no-cache shadow git

# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
RUN groupadd -g $USER_GID $USERNAME \
&& useradd -s /bin/sh -K MAIL_DIR=/dev/null -u $USER_UID -g $USER_GID -m $USERNAME

# Add Sudo to allow occasional usage of root. I wish I could remove this but I can't seem to get the node_modules volume working correctly.
RUN apk add --no-cache sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
&& echo node ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/node \
&& chmod 0440 /etc/sudoers.d/node


CMD [ "tail", "-f", "/dev/null" ]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ When you open this folder in VSCode you should get a notication to reopen in con

- Performance improvements. (Better file/import finding.)

Bunch more TODOs are documented in code, open repo and launch container, Todo Tree is added to the Dev container automatically.

## Testing

**MUST HAVE NODE.JS v13.7 or newer**
Expand Down
Loading