-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
70 lines (43 loc) · 2.35 KB
/
Copy pathDockerfile
File metadata and controls
70 lines (43 loc) · 2.35 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# syntax=docker/dockerfile:1.7-labs
FROM node:12 AS node12
WORKDIR /workspace
RUN apt-get update -y && apt-get install -y build-essential libssl-dev libcurl4-openssl-dev
COPY package.json ./
RUN npm install -g npm && npm install
CMD ["sh", "-c", "npm run build && mkdir -p tmp/logs && npm test > tmp/logs/node-12.test.log 2>&1"]
FROM node:14 AS node14
WORKDIR /workspace
RUN apt-get update -y && apt-get install -y build-essential libssl-dev libcurl4-openssl-dev
COPY package.json ./
RUN npm install -g npm && npm install
CMD ["sh", "-c", "npm run build && mkdir -p tmp/logs && npm test > tmp/logs/node-14.test.log 2>&1"]
FROM node:16 AS node16
WORKDIR /workspace
RUN apt-get update -y && apt-get install -y build-essential libssl-dev libcurl4-openssl-dev
COPY package.json ./
RUN npm install -g npm && npm install
CMD ["sh", "-c", "npm run build && mkdir -p tmp/logs && npm test > tmp/logs/node-16.test.log 2>&1"]
FROM node:18 AS node18
WORKDIR /workspace
RUN apt-get update -y && apt-get install -y build-essential libssl-dev libcurl4-openssl-dev
COPY package.json ./
RUN curl -L -o .yarnrc.yml https://raw.githubusercontent.com/dimaslanjaka/nodejs-package-types/refs/heads/main/.yarnrc-template.yml
RUN corepack enable && corepack prepare yarn@stable --activate
RUN touch yarn.lock && yarn install
CMD ["sh", "-c", "yarn run build && mkdir -p tmp/logs && yarn test > tmp/logs/node-18.test.log 2>&1"]
FROM node:20 AS node20
WORKDIR /workspace
RUN apt-get update -y && apt-get install -y build-essential libssl-dev libcurl4-openssl-dev
COPY package.json ./
RUN curl -L -o .yarnrc.yml https://raw.githubusercontent.com/dimaslanjaka/nodejs-package-types/refs/heads/main/.yarnrc-template.yml
RUN corepack enable && corepack prepare yarn@stable --activate
RUN touch yarn.lock && yarn install
CMD ["sh", "-c", "yarn run build && mkdir -p tmp/logs && yarn test > tmp/logs/node-20.test.log 2>&1"]
FROM node:22 AS node22
WORKDIR /workspace
RUN apt-get update -y && apt-get install -y build-essential libssl-dev libcurl4-openssl-dev
COPY package.json ./
RUN curl -L -o .yarnrc.yml https://raw.githubusercontent.com/dimaslanjaka/nodejs-package-types/refs/heads/main/.yarnrc-template.yml
RUN corepack enable && corepack prepare yarn@stable --activate
RUN touch yarn.lock && yarn install
CMD ["sh", "-c", "yarn run build && mkdir -p tmp/logs && yarn test > tmp/logs/node-22.test.log 2>&1"]