Skip to content

Instantly share code, notes, and snippets.

@dwdraju
Created May 12, 2020 10:39
Show Gist options
  • Save dwdraju/434e14f24aee0005ba355a54f12437a0 to your computer and use it in GitHub Desktop.
Save dwdraju/434e14f24aee0005ba355a54f12437a0 to your computer and use it in GitHub Desktop.
Github package usage dockerfile
FROM node:12-alpine
ARG GITHUB_AUTH_TOKEN
ENV GITHUB_AUTH_TOKEN=$GITHUB_AUTH_TOKEN
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
WORKDIR /home/node/app
COPY package.json ./
RUN echo -e "@dwdraju:registry=https://npm.pkg.github.com\n//npm.pkg.github.com/:_authToken=$GITHUB_AUTH_TOKEN" > .npmrc
RUN npm install
COPY --chown=node:node . .
CMD npm start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment