-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
56 lines (44 loc) · 989 Bytes
/
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
###
# Builder
###
FROM docker.io/node:20-slim AS builder
USER 0
RUN apt-get update && apt-get install -y \
g++ \
gcc \
make \
python3
# RUN yarn config set strict-ssl false
# ENV NODE_TLS_REJECT_UNAUTHORIZED=0
RUN yarn global add node-gyp
WORKDIR /app
COPY yarn.lock package.json ./
COPY ./packages/common/package.json ./packages/common/
COPY ./packages/frontend/package.json ./packages/frontend/
COPY ./packages/backend/package.json ./packages/backend/
RUN yarn install --frozen-lockfile
COPY . .
RUN yarn build
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
RUN rm -rf node_modules
RUN yarn install --frozen-lockfile
###
# Runner
###
FROM docker.io/node:20-slim AS runner
USER 0
RUN apt-get update && apt-get install -y \
curl \
tini \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app /app
USER 1000
ENV URL=http://0.0.0.0
ENV PORT=3000
ENV NODE_ENV=${NODE_ENV}
EXPOSE 3000
EXPOSE 3001
ENTRYPOINT [ "tini", "--" ]
CMD [ "yarn", "start" ]