Skip to content

Instantly share code, notes, and snippets.

@rwcitek
Created December 27, 2023 15:07
Show Gist options
  • Save rwcitek/315e0689bfac638291f3ccc05a12dbd6 to your computer and use it in GitHub Desktop.
Save rwcitek/315e0689bfac638291f3ccc05a12dbd6 to your computer and use it in GitHub Desktop.
Angular in Docker

Angular in Docker

cut -c3- <<'eof' > Dockerfile
  FROM node
  
  WORKDIR /app
  SHELL ["/bin/bash","-c"]
  
  RUN  apt-get update && apt-get dist-upgrade -y
  RUN  apt-get install -y tree curl jq less vim
  RUN  git config --global user.email "[email protected]"
  RUN  git config --global user.name "Foo Bar"
  RUN  git config --global init.defaultBranch main
  RUN  npm install -g @angular/cli
  RUN  yes '' | ng new project01
  
  CMD  ["/bin/bash"]
  
  COPY Dockerfile /

eof
docker image build --tag angular .
docker container run \
  --rm \
  --detach \
  --workdir /app/project01 \
  --publish 127.10.10.10:4200:4200 \
  --name angular \
  angular \
    ng serve --host 0.0.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment