Skip to content

Commit

Permalink
devcontainer for ts-loader (#1143)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyreilly committed Jul 13, 2020
1 parent cb487e4 commit c2bc68c
Show file tree
Hide file tree
Showing 9 changed files with 442 additions and 3 deletions.
40 changes: 40 additions & 0 deletions .devcontainer/Dockerfile
@@ -0,0 +1,40 @@
#-------------------------------------------------------------------------------------------------------------
# Based on:
# https://github.com/microsoft/vscode-dev-containers/tree/v0.122.1/containers/typescript-node-14/.devcontainer/Dockerfile
#-------------------------------------------------------------------------------------------------------------

FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:14

# The javascript-node image includes a non-root node 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 image
# or dockerFile property. Update USER_UID/USER_GID below if you are using the
# dockerComposeFile property or want the image itself to start with different ID
# values. See https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=node
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Alter node user as needed. eslint is installed by javascript image
RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
groupmod --gid $USER_GID $USERNAME \
&& usermod --uid $USER_UID --gid $USER_GID $USERNAME \
&& chmod -R $USER_UID:$USER_GID /home/$USERNAME \
&& chmod -R $USER_UID:root /usr/local/share/nvm /usr/local/share/npm-global; \
fi

# Set the Chrome repo.
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list

# Install Chrome.
RUN apt-get update && apt-get -y install google-chrome-stable \
&& rm -rf /var/lib/apt/lists/*


# ** [Optional] Uncomment this section to install additional packages. **
#
# RUN apt-get update \
# && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

25 changes: 25 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,25 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.122.1/containers/typescript-node-14
{
"name": "ts-loader devcontainer",
"dockerFile": "Dockerfile",

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

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [/* for debugging execution tests */ 9876],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "yarn install",

// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "node"
}
1 change: 1 addition & 0 deletions .dockerignore
@@ -1,3 +1,4 @@
.devcontainer
.git
.github
.vscode
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -20,4 +20,5 @@ npm-debug.log
.pnp
.pnp.js
!.eslintrc.js
.vs/**
.vs/**
.pnpm-store
1 change: 1 addition & 0 deletions .npmignore
@@ -1,3 +1,4 @@
.devcontainer
.vscode
.test
examples
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -6,6 +6,7 @@ language: node_js
node_js:
- "10"
- "12"
- "14"
sudo: required
install:
- yarn install
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,4 +1,4 @@
FROM node:10
FROM node:14

# See https://crbug.com/795759
RUN apt-get update && apt-get install -yq libgconf-2-4
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
@@ -1,7 +1,7 @@
image: Visual Studio 2017
environment:
FORCE_COLOR: 1
nodejs_version: "10"
nodejs_version: "14"
matrix:
- TYPESCRIPT: typescript@3.9.3
- TYPESCRIPT: typescript@next
Expand Down

0 comments on commit c2bc68c

Please sign in to comment.