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