refactor: use yarn in dockerfile (#309)
* refactor: use yarn in dockerfile * refactor: upgrade node to 12.x
This commit is contained in:
Родитель
5d945f8f7b
Коммит
da7b488d2e
|
@ -1,5 +1,5 @@
|
|||
# Stage 1
|
||||
FROM node:10 AS build
|
||||
FROM node:12 AS build
|
||||
|
||||
# Create app directory
|
||||
WORKDIR /usr/src/app
|
||||
|
@ -10,12 +10,13 @@ ENV PATH /usr/src/app/node_modules/.bin:$PATH
|
|||
# A wildcard is used to ensure both package.json AND package-lock.json are copied
|
||||
# where available (npm@5+)
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY yarn.lock ./
|
||||
RUN yarn install
|
||||
|
||||
COPY . .
|
||||
|
||||
# Build the app for production
|
||||
RUN npm run build
|
||||
RUN yarn build
|
||||
|
||||
# Stage 2
|
||||
# Use Nginx to serve files
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
FROM node:10 AS build
|
||||
FROM node:12 AS build
|
||||
WORKDIR /usr/src/app
|
||||
ENV PATH /usr/src/app/node_modules/.bin:$PATH
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY yarn.lock ./
|
||||
RUN yarn install
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
RUN yarn build
|
||||
FROM nginx:1.18.0-alpine
|
||||
WORKDIR /usr/src/app
|
||||
COPY --from=build /usr/src/app/run.sh .
|
||||
|
|
|
@ -12,7 +12,7 @@ pool:
|
|||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '10.x'
|
||||
versionSpec: '12.x'
|
||||
displayName: 'Install Node.js'
|
||||
|
||||
- script: |
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
"webpack-merge": "^4.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.14.2",
|
||||
"node": ">=12.13.1",
|
||||
"npm": ">=6.4.1"
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче