-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-front
35 lines (22 loc) · 908 Bytes
/
Dockerfile-front
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
FROM node:16.14.2-alpine3.15 AS build
WORKDIR /app
RUN apk add --no-cache protoc go
# install protoc plugins
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0 \
&& export PATH="$PATH:$(go env GOPATH)/bin" \
&& wget -O /usr/local/bin/protoc-gen-grpc-web https://github.com/grpc/grpc-web/releases/download/1.3.1/protoc-gen-grpc-web-1.3.1-linux-x86_64 \
&& chmod u+x /usr/local/bin/protoc-gen-grpc-web
COPY helloworld.proto .
RUN protoc helloworld.proto \
--js_out=import_style=commonjs:. \
--grpc-web_out=import_style=commonjs,mode=grpcwebtext:.
COPY package.json .
COPY package-lock.json .
RUN npm install
COPY client.js .
RUN npx webpack build ./client.js
FROM python:3.10.3-alpine3.15
WORKDIR /app
COPY --from=build /app/dist dist/
COPY index.html .
ENTRYPOINT ["python", "-m", "http.server", "8081"]