forked from wundergraph/cosmo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (24 loc) · 987 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
FROM node:18 as builder
WORKDIR /app
# Ensure we have pnpm available to us
RUN npm install --global pnpm@8
# Files required by pnpm install.
COPY .npmrc package.json pnpm-lock.yaml pnpm-workspace.yaml ./
# Files required by pnpm install for each package. Tried pnpm fetch but errors.
COPY connect/package.json connect/
COPY shared/package.json shared/
COPY composition/package.json composition/
COPY controlplane/package.json controlplane/
RUN pnpm install --filter=wundergraph-cosmo --filter=./connect --filter=./shared --filter=./controlplane --filter=./composition --frozen-lockfile
COPY . /app/
RUN pnpm buf generate --template buf.ts.gen.yaml
RUN pnpm run --filter=./connect --filter=./shared --filter=./controlplane --filter=./composition build
# Deploy
RUN pnpm --filter=./controlplane --prod deploy pruned
FROM node:18-slim
WORKDIR /app
ENV NODE_ENV production
# Fetch built artifacts
COPY --from=builder /app/pruned .
CMD ["node", "dist", "index.js"]
EXPOSE 3001