-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
65 lines (36 loc) · 1.02 KB
/
Dockerfile
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM node:18 as build
WORKDIR /app
COPY tsconfig.json ./
COPY package*.json ./
RUN npm ci
COPY src src
COPY imageenv.json ./
COPY rollup.config.js ./
RUN npm run build
FROM node:18-slim as node
FROM ubuntu:jammy as base
ENV NODE_ENV=production
COPY --from=node /usr/local/include/ /usr/local/include/
COPY --from=node /usr/local/lib/ /usr/local/lib/
COPY --from=node /usr/local/bin/ /usr/local/bin/
RUN corepack disable && corepack enable
RUN apt update && apt install -y openssl
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
FROM base as deps
RUN apt install -y python3 make g++
WORKDIR /app
ENV NODE_ENV=production
COPY package*.json ./
COPY prisma ./prisma
RUN npm ci --omit=dev
FROM base as prod
USER node
WORKDIR /app
COPY --chown=node:node package*.json ./
COPY --chown=node:node --from=deps /app/node_modules ./node_modules
COPY --chown=node:node --from=build /app/dist ./dist
ENV NODE_ENV=production
#EXPOSE 80
#EXPOSE 443
CMD ["npm", "start"]