Last active
July 13, 2023 08:52
-
-
Save ahmedazhar05/28f65c34ec511f07fa8ed6878c6a65d7 to your computer and use it in GitHub Desktop.
Docker image configuration for on-the-go TypeScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:latest | |
ARG UID | |
ARG GID | |
RUN apt update -y \ | |
&& apt upgrade -y | |
USER $UID:$GID | |
RUN mkdir -p "$HOME/.npm-global" \ | |
&& npm config set prefix "$HOME/.npm-global" \ | |
&& npm install -g npm@latest \ | |
&& npm install -g typescript | |
WORKDIR /workspace | |
# $HOME=/home/node automatically once you set the instruction USER <UID>[:<GID>] | |
ENTRYPOINT ["/home/node/.npm-global/bin/tsc"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Build command:
Set alias in bash
Now you can run typescript from anywhere