-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (24 loc) · 764 Bytes
/
Dockerfile
File metadata and controls
38 lines (24 loc) · 764 Bytes
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
FROM node:24-alpine AS build
RUN corepack enable
RUN yarn set version berry
RUN apk add dumb-init
WORKDIR /home/node
COPY . .
RUN yarn install --immutable
RUN yarn build
FROM node:24-alpine
ENV NODE_ENV=production
COPY --from=build /usr/bin/dumb-init /usr/bin/dumb-init
RUN apk update && \
apk upgrade --no-cache && \
corepack enable && \
yarn set version berry && \
addgroup --gid 3000 --system juffgroup && \
adduser --uid 2000 --system --ingroup juffgroup juffuser && \
mkdir /home/juffuser/express-graphql-example/
USER 2000:3000
WORKDIR /home/juffuser/express-graphql-example/
COPY --from=build /home/node/dist ./dist
COPY --from=build /home/node/node_modules ./node_modules
EXPOSE 3010
CMD [ "dumb-init", "node", "dist/index.js" ]