forked from zazuko/cube-creator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.Dockerfile
50 lines (38 loc) · 1.4 KB
/
cli.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
# First step: build the assets
FROM node:18-alpine AS builder
WORKDIR /app
ADD package.json yarn.lock ./
ADD ./cli/package.json ./cli/
ADD ./packages/core/package.json ./packages/core/
ADD ./packages/model/package.json ./packages/model/
ADD ./packages/testing/package.json ./packages/testing/
# for every new package foo add:
# ADD ./packages/foo/package.json ./packages/foo/
# install and build backend
RUN yarn install --frozen-lockfile
COPY . .
RUN rm -rf ./ui
RUN rm -rf ./apis
RUN rm -rf ./packages/express
RUN rm -rf ./packages/express-rdf-request
RUN rm -rf ./packages/shacl-middleware
RUN yarn tsc --outDir dist --module CommonJS
FROM node:18-alpine
WORKDIR /app
ADD package.json yarn.lock ./
ADD ./cli/package.json ./cli/
ADD ./cli/shapes.ttl ./cli/
ADD ./cli/lib/toCubeShape ./cli/lib/toCubeShape/
ADD ./cli/pipelines ./cli/pipelines/
ADD ./packages/core/package.json ./packages/core/
ADD ./packages/model/package.json ./packages/model/
ADD ./packages/testing/package.json ./packages/testing/
# for every new package foo add
#ADD ./packages/foo/package.json ./packages/foo/
RUN yarn install --production --frozen-lockfile
COPY --from=builder /app/dist/cli ./cli/
COPY --from=builder /app/dist/packages/ ./packages/
# build with `docker build --build-arg COMMIT=$(git rev-parse HEAD)`
ARG COMMIT
ENV SENTRY_RELEASE=cube-creator-cli@$COMMIT
ENTRYPOINT ["node", "--unhandled-rejections=strict", "cli/index.js"]