A simple node server that returns the IP address of the computer that sends it a request.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile 718B

1234567891011121314151617181920212223242526272829303132333435
  1. FROM node:9.5.0 as builder
  2. ARG NODE_ENV=production
  3. ENV NODE_ENV $NODE_ENV
  4. WORKDIR /home/node/app
  5. COPY src/package*.json ./
  6. RUN npm install && npm cache clean --force
  7. FROM node:9.5.0-alpine as app
  8. ARG PORT=3060
  9. ENV PORT $PORT
  10. EXPOSE $PORT
  11. ARG NODE_ENV=production
  12. ENV NODE_ENV $NODE_ENV
  13. ARG NPM_CONFIG_PREFIX=/home/node/.npm-global
  14. ENV NPM_CONFIG_PREFIX=$NPM_CONFIG_PREFIX
  15. ENV PATH /home/node/.npm-global/bin:$PATH
  16. WORKDIR /home/node/app
  17. RUN npm install nodemon -g && mkdir -p /home/node/app && chown -R node:node /home/node/
  18. COPY --chown=node:node --from=builder /home/node/app/node_modules node_modules/
  19. COPY --chown=node:node ./src ./src
  20. USER node:node
  21. WORKDIR /home/node/app/src
  22. CMD ["node", "bin/www"]