2. Typescript Journey - Setup
I am going to using Dev Containers to do my development. This will allow me to use a docker container or Github Codespaces to do my Typescript development.
Prerequisites
- Docker Desktop
- Visual Studio Code
- Visual Studio Code Extension - Dev Containers,GitHub Codespaces
Walkthrough
- Setup Dev Container Configuration Files
View -> Command Palette -> Remote Containers: Add Development Container Configuration Files
- Choose Alpine and Latest Version
- Open Folder in Container
</br> - Change Dockerfile and devcontainer.json to support Typescript and Node
Dockerfile
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-12
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install git
devcontainer.json
{
"build": {"dockerfile": "Dockerfile"},
"customizations": {
"vscode": {
"extensions": ["dbaeumer.vscode-eslint"]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000]
}