Skip to content

Instantly share code, notes, and snippets.

@galkin
Created August 10, 2019 12:04
Show Gist options
  • Save galkin/77c9fea22b07eb2f6aa9bcef84f83f23 to your computer and use it in GitHub Desktop.
Save galkin/77c9fea22b07eb2f6aa9bcef84f83f23 to your computer and use it in GitHub Desktop.
Infinity Node.js

Links

API runner

API testing

Google it

  • express-http-proxy
  • Илья Климов
  • nginx-proxy-letsencrypt

Docker example with pm2

FROM node:10.16.1-alpine

RUN npm install [email protected] -g
ENV WEBAPI_INSTANCES=max
ENV APP_WORKDIR=/usr/src/app/

COPY ecosystem.config.js package.json package-lock.json .env.example tsconfig.json tsconfig.build.json $APP_WORKDIR
WORKDIR $APP_WORKDIR

RUN npm install --no-optional
COPY src $APP_WORKDIR/src
RUN npm run build

RUN rm -rf tsconfig.json tsconfig-app.json src
RUN npm prune --production

EXPOSE 80
ENTRYPOINT ["pm2-runtime", "ecosystem.config.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment