File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Copyright (C) 2021 Edge Network Technologies Limited
2
+ # Use of this source code is governed by a GNU GPL-style license
3
+ # that can be found in the LICENSE.md file. All rights reserved.
4
+
5
+ FROM node:lts AS build
6
+ RUN npm install -g pkg-fetch
7
+
8
+ # Configure, download target Node base binary
9
+ ARG targetNode=node16
10
+ ARG targetPlatform=alpine
11
+ ARG targetArch=x64
12
+ RUN pkg-fetch -n ${targetNode} -p ${targetPlatform} -a ${targetArch}
13
+
14
+ WORKDIR /build
15
+
16
+ # Install dependencies
17
+ COPY package*.json ./
18
+ RUN npm install
19
+
20
+ # Copy and transpile app src
21
+ COPY src ./src
22
+ COPY tsconfig.json ./
23
+ RUN npm run build:src
24
+
25
+ # Package binary
26
+ RUN npx pkg . \
27
+ --target $targetNode-$targetPlatform-$targetArch \
28
+ --output bin/faucet
29
+
30
+ # Copy binary to clean alpine image
31
+ FROM alpine:latest
32
+ COPY --from=build /build/bin/faucet /usr/local/bin/faucet
33
+
34
+ ENTRYPOINT ["faucet" ]
35
+ CMD ["" ]
You can’t perform that action at this time.
0 commit comments