Skip to content

Commit 7daddb4

Browse files
authored
use workdir and run as non root user (Unleash#39)
Signed-off-by: André Bauer <[email protected]>
1 parent be09d19 commit 7daddb4

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Dockerfile

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
FROM node:12-alpine
1+
FROM node:12-alpine as builder
22

3-
ENV NODE_ENV production
3+
WORKDIR /unleash
44

5-
COPY package.json package-lock.json ./
5+
COPY index.js package.json package-lock.json ./
66

77
RUN npm ci
88

9-
COPY . .
9+
FROM node:12-alpine
10+
11+
ENV NODE_ENV production
12+
13+
WORKDIR /unleash
14+
15+
COPY --from=builder /unleash /unleash
1016

1117
EXPOSE 4242
1218

19+
USER node
20+
1321
CMD node index.js

0 commit comments

Comments
 (0)