This repository has been archived by the owner on Apr 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile_
45 lines (36 loc) · 1.57 KB
/
Dockerfile_
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#FROM mhart/alpine-node:10
#FROM node:10-alpine
FROM node:10.11.0-alpine as builder
WORKDIR /app
RUN apk add --no-cache curl git && cd /tmp && \
curl -#L https://github.com/tj/node-prune/releases/download/v1.0.1/node-prune_1.0.1_linux_amd64.tar.gz | tar -xvzf- && \
mv -v node-prune /usr/local/bin && rm -rvf * && \
echo "yarn cache clean && node-prune" > /usr/local/bin/node-clean && chmod +x /usr/local/bin/node-clean
RUN yarn config set registry https://registry.npm.taobao.org -g
RUN yarn config set disturl https://npm.taobao.org/dist -g
# RUN yarn config set electron_mirror https://npm.taobao.org/mirrors/electron/ -g
# RUN yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ -g
RUN yarn config set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs/ -g
RUN yarn config set chromedriver_cdnurl https://cdn.npm.taobao.org/dist/chromedriver -g
RUN yarn config set operadriver_cdnurl https://cdn.npm.taobao.org/dist/operadriver -g
RUN yarn config set fse_binary_host_mirror https://npm.taobao.org/mirrors/fsevents -g
#RUN mkdir -p /app
#WORKDIR /app
# Install app dependencies
COPY package.json ./
RUN yarn install
#RUN yarn --frozen-lockfile --non-interactive
ADD . ./
RUN yarn build
ENV NODE_ENV=production
RUN yarn --frozen-lockfile --non-interactive --production && node-clean
FROM node:10.11.0-alpine
WORKDIR /app
ENV HOST=0.0.0.0
ADD package.json ./
ADD nuxt.config.js ./
COPY --from=builder ./app/node_modules ./node_modules/
COPY --from=builder ./app/.nuxt ./.nuxt/
COPY --from=builder ./app/static ./src/static/
EXPOSE 3000
CMD ["yarn", "start"]