-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (19 loc) · 742 Bytes
/
Copy pathDockerfile
File metadata and controls
26 lines (19 loc) · 742 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
# syntax = docker/dockerfile:1
FROM node:lts-alpine AS build_image
WORKDIR /app
COPY ["package.json", "package-lock.json*", "./"]
RUN npm install --no-fund --no-audit
COPY . .
RUN npm run build
ARG USE_SENTRY
RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN,env=SENTRY_AUTH_TOKEN if [ -n "$USE_SENTRY" ]; then npm run sentry-docker; fi
RUN npm install --no-audit --no-fund --omit=dev && wget https://gobinaries.com/tj/node-prune --output-document - | /bin/sh && node-prune
FROM node:lts-alpine
WORKDIR /app
COPY --from=build_image /app/package.json ./package.json
COPY --from=build_image /app/dist ./dist
COPY --from=build_image /app/node_modules ./node_modules
RUN chown -R 1000:1000 /app
USER 1000
EXPOSE 8080
CMD ["npm", "run", "start"]