Skip to content

Commit 94d576b

Browse files
use debian image with rootless user, yarn with --prod option (#519)
1 parent be7ac3d commit 94d576b

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
FROM node:18.12.1-alpine
1+
FROM node:18.12.1-bullseye-slim
2+
3+
RUN adduser --gecos "" --disabled-password --home /home/cfu --shell /bin/bash cfu
24

35
WORKDIR /app/
46

57
COPY package.json .
68
COPY yarn.lock .
79

8-
RUN yarn
10+
RUN yarn --prod
11+
12+
COPY --chown=cfu --chmod=775 . .
13+
14+
RUN mkdir /cf-outputs && chmod 775 /cf-outputs && chown cfu /cf-outputs
915

10-
COPY . .
16+
USER cfu
1117

1218
CMD [ "node", "/app/src/index.js" ]
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
FROM node:18.12.1-alpine
1+
FROM node:18.12.1-bullseye-slim
2+
3+
RUN adduser --gecos "" --disabled-password --home /home/cfu --shell /bin/bash cfu
24

35
WORKDIR /app/
46

57
COPY package.json .
68
COPY yarn.lock .
79

8-
RUN yarn
10+
RUN yarn --prod
11+
12+
COPY --chown=cfu --chmod=775 . .
13+
14+
RUN mkdir /cf-outputs && chmod 775 /cf-outputs && chown cfu /cf-outputs
915

10-
COPY . .
16+
USER cfu
1117

1218
CMD [ "node", "/app/src/index.js" ]
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
FROM node:18.12.1-alpine
1+
FROM node:18.12.1-bullseye-slim
2+
3+
RUN adduser --gecos "" --disabled-password --home /home/cfu --shell /bin/bash cfu
24

35
WORKDIR /app/
46

57
COPY package.json .
68
COPY yarn.lock .
79

8-
RUN yarn
10+
RUN yarn --prod
11+
12+
COPY --chown=cfu --chmod=775 . .
13+
14+
RUN mkdir /cf-outputs && chmod 775 /cf-outputs && chown cfu /cf-outputs
915

10-
COPY . .
16+
USER cfu
1117

1218
CMD [ "node", "/app/src/index.js" ]

0 commit comments

Comments
 (0)