-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (29 loc) · 990 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (29 loc) · 990 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
FROM node:16 AS builder
ARG STAGING=${STAGING}
ARG HOST=${HOST}
ARG APP_SERVER_URL=${APP_SERVER_URL}
ARG CLIENT_PORT=${CLIENT_PORT}
ARG REALTIME_SERVER_URL=${REALTIME_SERVER_URL}
ARG COLLAB_SERVER_URL=${COLLAB_SERVER_URL}
RUN npm install -g pnpm@^8.0.0
WORKDIR /build
COPY ./ ./
RUN pnpm install --filter deepnotes --filter @deepnotes/client...
RUN pnpm turbo run build --filter @deepnotes/client...
WORKDIR /build/apps/client
RUN pnpm run build:ssr
RUN pnpm tsup
FROM node:16-alpine AS runner
RUN npm install -g pnpm@^8.0.0
RUN mkdir /usr/local/pnpm
ENV PNPM_HOME="/usr/local/pnpm"
ENV PATH="${PATH}:/usr/local/pnpm"
RUN pnpm add -g pm2
WORKDIR /app
COPY --from=builder /build/apps/client/dist/ssr ./
COPY --from=builder /build/.npmrc ./
RUN sed -i 's/"use strict";//g' ./index.cjs
RUN pnpm remove @deeplib/data @deeplib/misc @stdlib/base64 \
@stdlib/color @stdlib/crypto @stdlib/data @stdlib/misc \
@stdlib/vue @deepnotes/app-server
CMD pm2 start ./index.cjs -i max && pm2 logs