-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcli.Dockerfile
52 lines (40 loc) · 1.44 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
51
52
# First step: build the assets
FROM node:18-alpine AS builder
WORKDIR /app
COPY package.json yarn.lock ./
COPY ./cli/package.json ./cli/
COPY ./packages/core/package.json ./packages/core/
COPY ./packages/model/package.json ./packages/model/
COPY ./packages/testing/package.json ./packages/testing/
# for every new package foo add:
# COPY ./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 ./cli/test
RUN rm -rf ./packages/model/test
RUN rm -rf ./packages/testing
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
COPY package.json yarn.lock ./
COPY ./cli/package.json ./cli/
COPY ./cli/*.ttl ./cli/
COPY ./cli/pipelines ./cli/pipelines/
COPY ./packages/core/package.json ./packages/core/
COPY ./packages/model/package.json ./packages/model/
COPY ./packages/testing/package.json ./packages/testing/
# for every new package foo add
#COPY ./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"]