-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathweb.dockerfile
More file actions
46 lines (29 loc) · 1.2 KB
/
web.dockerfile
File metadata and controls
46 lines (29 loc) · 1.2 KB
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
FROM node:18 AS polycentric_src
WORKDIR /polycentric
RUN mkdir -p server/src/
# Copy the entire monorepo
COPY version.sh version.sh
COPY proto proto
COPY packages/polycentric-core packages/polycentric-core
COPY packages/polycentric-react packages/polycentric-react
COPY packages/polycentric-web packages/polycentric-web
COPY package.json package.json
COPY package-lock.json package-lock.json
RUN ./version.sh
# Install root dependencies
RUN npm install
RUN npm install -g protoc
RUN protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=esModuleInterop=true --ts_proto_opt=forceLong=long --ts_proto_out=. --experimental_allow_proto3_optional proto/protocol.proto
RUN cp proto/protocol.ts packages/polycentric-core/src/protocol.ts
# Setup polycentric-core with minimal stubs for the imports
WORKDIR /polycentric/packages/polycentric-core
RUN npm run build
WORKDIR /polycentric/packages/polycentric-react
RUN npm run build
WORKDIR /polycentric/packages/polycentric-web
RUN npm run build
RUN npm install -g wrangler
# Start from a basic nginx image
FROM nginx:1.27.4
RUN rm -rf /usr/share/nginx/html
COPY --from=polycentric_src /polycentric/packages/polycentric-web/dist/ /usr/share/nginx/html