Dockerfile 775 B

123456789101112131415161718192021222324252627
  1. FROM node:lts-alpine as base
  2. RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
  3. RUN set -o errexit -o nounset \
  4. echo "Installing base package" \
  5. && apk --no-cache update && apk --no-cache upgrade \
  6. && apk add --no-cache curl bash tzdata tar unzip xz procps wget git openssh \
  7. && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
  8. echo "Asia/Shanghai" > /etc/timezone \
  9. && apk add --no-cache tini \
  10. && rm -fr /tmp/* /var/cache/apk/*
  11. ENV NODE_ENV=production
  12. ENV LANG C.UTF-8
  13. ENV TZ Asia/Shanghai
  14. RUN npm install -g cnpm --registry=https://registry.npm.taobao.org
  15. USER node
  16. WORKDIR /app
  17. COPY package*.json ./
  18. RUN npm install
  19. COPY . .
  20. RUN chown -R appuser:appgroup /app
  21. EXPOSE 8080
  22. CMD [ "npm", "start" ]