Skip to content

Instantly share code, notes, and snippets.

@btshft
Created July 2, 2020 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btshft/ef92813466f01ab5e4ca0e16a0c440d3 to your computer and use it in GitHub Desktop.
Save btshft/ef92813466f01ab5e4ca0e16a0c440d3 to your computer and use it in GitHub Desktop.
Scan typescript app
FROM node:lts-buster
# Install OpenJDK-11
RUN apt-get update && \
apt-get install -y openjdk-11-jdk && \
apt-get install -y ant && \
apt-get clean;
# Fix certificate issues
RUN apt-get update && \
apt-get install ca-certificates-java && \
apt-get clean && \
update-ca-certificates -f;
# Setup JAVA_HOME -- useful for docker commandline
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/
RUN export JAVA_HOME
# Install Google Chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
RUN apt-get update && apt-get install -y google-chrome-stable
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm install sonar-scanner --save-dev
RUN npm install
COPY . .
RUN npm test -- --codeCoverage=true --watch=false
RUN npm run sonar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment