Skip to content

Commit eb5595b

Browse files
committed
Modified DockerFile.
1 parent 3d04110 commit eb5595b

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

Dockerfile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
# Use Alpine and install Node.js which is 50% smaller than the -alpine version of the node
2-
# image (53 MB including the faucet app).
3-
FROM alpine:3.15 as build-env
4-
# Installs Node.js 16 (https://pkgs.alpinelinux.org/packages?name=nodejs&branch=v3.15)
1+
FROM node:slim as build-env
52

6-
RUN apk add --update nodejs
7-
RUN apk add --update npm
8-
RUN apk add --update ca-certificates jq bash curl
93

10-
WORKDIR /home/faucet/
4+
WORKDIR /faucet/
115
COPY . .
126

137
RUN npm ci
8+
RUN npx esbuild server.js --bundle --platform=node --outfile=index.js
9+
10+
11+
FROM node:slim
12+
13+
WORKDIR /app/
14+
15+
COPY --from=build-env /faucet/index.js /app/index.js
16+
17+
CMD node /app/index.js
1418

1519
EXPOSE 5000

0 commit comments

Comments
 (0)