Use bazel to build echo_server example

This commit is contained in:
Stanley Cheung 2021-03-13 00:47:50 -08:00 committed by Stanley Cheung
parent 3d7789ab28
commit 247e211031
4 changed files with 5 additions and 84 deletions

View File

@ -12,19 +12,12 @@ services:
depends_on:
- common
image: grpcweb/prereqs
grpc-base:
build:
context: ./
dockerfile: ./net/grpc/gateway/docker/grpc_base/Dockerfile
depends_on:
- prereqs
image: grpcweb/grpc-base
echo-server:
build:
context: ./
dockerfile: ./net/grpc/gateway/docker/echo_server/Dockerfile
depends_on:
- grpc-base
- prereqs
image: grpcweb/echo-server
ports:
- "9090:9090"
@ -55,17 +48,6 @@ services:
- "8080:8080"
links:
- node-server
nginx:
build:
context: ./
dockerfile: ./net/grpc/gateway/docker/nginx/Dockerfile
depends_on:
- grpc-base
image: grpcweb/nginx
ports:
- "8080:8080"
links:
- echo-server
grpcwebproxy:
build:
context: ./

View File

@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM grpcweb/grpc-base
FROM grpcweb/prereqs
WORKDIR /github/grpc-web
RUN make echo_server
RUN bazel build net/grpc/gateway/examples/echo:server
WORKDIR /github/grpc-web/net/grpc/gateway/examples/echo
WORKDIR /github/grpc-web/bazel-bin/net/grpc/gateway/examples/echo
EXPOSE 9090
CMD ["./echo_server"]
CMD ["./server"]

View File

@ -1,23 +0,0 @@
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM grpcweb/prereqs
WORKDIR /github/grpc-web
RUN cd third_party/grpc && \
make install
RUN cd third_party/grpc/third_party/protobuf && \
make install

View File

@ -1,38 +0,0 @@
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM grpcweb/grpc-base
RUN apt-get -qq install -y \
cmake zip
WORKDIR /github/grpc-web
RUN cd third_party/grpc/third_party && \
ln -s ./abseil-cpp/absl absl
RUN cd third_party/grpc/third_party/abseil-cpp && \
git remote update && \
git checkout df3ea78 -b 20200225.1 && \
cmake . && \
make && \
make install
RUN cd ./net/grpc/gateway/examples/echo && \
sed -i 's/localhost:9090/echo-server:9090/g' nginx.conf
RUN make standalone-proxy
EXPOSE 8080
CMD ["./gConnector_static/nginx.sh"]