-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.ts.libs
57 lines (39 loc) · 1.34 KB
/
Dockerfile.ts.libs
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
57
FROM oven/bun as install
WORKDIR /src
COPY package.json .
COPY libs/config/package.json libs/config/tsconfig.json libs/config/config.ts libs/config/
COPY libs/lib/package.json libs/lib/tsconfig.json libs/lib/
COPY libs/lib/src libs/lib/src/
COPY libs/grpc/package.json libs/grpc/tsconfig.json libs/grpc/
COPY libs/grpc/Cargo.toml libs/grpc/
COPY libs/grpc/src libs/grpc/src/
COPY libs/grpc/protos libs/grpc/protos/
COPY libs/grpc/lib libs/grpc/lib/
RUN mkdir frontend
RUN bun install
###
FROM node:18-alpine as builder
WORKDIR /app
RUN apk add protoc cargo go
RUN go install github.com/twitchtv/twirp/protoc-gen-twirp@latest
COPY --from=install /src/libs libs
COPY --from=install /src/node_modules node_modules
COPY package.json .
ENV TWIRP_TS_COMPILE="true"
WORKDIR /app/libs/grpc
RUN cargo run
WORKDIR /app
RUN cd libs/config && npm run ts
RUN cd libs/lib && npm run ts
RUN cd libs/grpc && npm run ts
# copy to libs-prod which would be smaller (size)
# COPY libs/config/package.json libs-prod/config/package.json
# COPY libs/config/dist libs-prod/config/dist
# COPY libs/lib/package.json libs-prod/lib/package.json
# COPY libs/lib/dist libs-prod/lib/dist
# COPY libs/grpc/package.json libs-prod/grpc/package.json
# COPY libs/grpc/.ts libs-prod/grpc/.ts
# COPY libs/grpc/.tslib libs-prod/grpc/.tslib
# RUN rm -rf libs
# # rename
# RUN mv libs-prod libs