-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dev
53 lines (43 loc) · 1.42 KB
/
Dockerfile.dev
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
# Pull official base node image
FROM node:14 as builder
# Set working directory
WORKDIR /app
# Add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# Install node dependencies
COPY package.json ./
RUN npm install
RUN npm install fetch
# START - PROTOBUF INSTALLATION
# Download proto zip
ENV PROTOC_ZIP=protoc-3.14.0-linux-x86_64.zip
RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/${PROTOC_ZIP}
RUN unzip -o ${PROTOC_ZIP} -d ./proto
RUN chmod 755 -R ./proto/bin
ENV BASE=/usr
# Copy into path
RUN cp ./proto/bin/protoc ${BASE}/bin/
RUN cp -R ./proto/include/* ${BASE}/include/
# Download protoc-gen-grpc-web
ENV GRPC_WEB=protoc-gen-grpc-web-1.2.1-linux-x86_64
ENV GRPC_WEB_PATH=/usr/bin/protoc-gen-grpc-web
RUN curl -OL https://github.com/grpc/grpc-web/releases/download/1.2.1/${GRPC_WEB}
# Copy into path
RUN mv ${GRPC_WEB} ${GRPC_WEB_PATH}
RUN chmod +x ${GRPC_WEB_PATH}
# END - PROTOBUF INSTALLATION
# COPY PROJECT FILES
COPY . ./
# COMPILE THE PROTO FILES
RUN protoc -I=/app/src/woz-app/connector/agent-dialogue/proto \
client.proto \
core_configuration.proto \
log.proto \
ratings.proto \
service.proto \
simulator_configuration.proto \
--js_out=import_style=commonjs:/app/src/woz-app/connector/agent-dialogue/generated \
--grpc-web_out=import_style=typescript,mode=grpcwebtext:/app/src/woz-app/connector/agent-dialogue/generated
EXPOSE 3000
# start app
CMD ["npm", "start"]