Last active
January 12, 2019 16:34
-
-
Save SC7639/a396bc63c5672020a0e6c1c283b57ed7 to your computer and use it in GitHub Desktop.
Revisions
-
SC7639 revised this gist
Jan 12, 2019 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,11 @@ #!/bin/sh # Run grpc server if [ "$ENV" = "production" ] then rr-grpc serve else # Build protobuf file protoc --php_out=src --php-grpc_out=src service.proto rr-grpc serve -v -d fi -
SC7639 created this gist
Jan 12, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ FROM alpine as build ADD https://github.com/spiral/php-grpc/releases/download/v1.0.0/rr-grpc-1.0.0-linux-amd64.tar.gz /rr-grpc/ ADD https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip /proto/ ADD https://github.com/spiral/php-grpc/releases/download/v1.0.0/protoc-gen-php-grpc-1.0.0-linux-amd64.tar.gz /protoc-php-grpc/ # Extract and copy protoc binary to /usr/local RUN unzip /proto/protoc-3.6.1-linux-x86_64.zip -d /proto/ # Extract rr-grpc RUN tar -xvzf /rr-grpc/rr-grpc-1.0.0-linux-amd64.tar.gz -C /rr-grpc/ # Extract rr-grpc RUN tar -xvzf /protoc-php-grpc/protoc-gen-php-grpc-1.0.0-linux-amd64.tar.gz -C /protoc-php-grpc/ RUN ls -al /protoc-php-grpc/ FROM php:7.2-fpm # Copy rr-grpc and protoc binary to /usr/local/bin COPY --from=build /rr-grpc/rr-grpc-1.0.0-linux-amd64/rr-grpc /usr/local/bin/ COPY --from=build /proto/bin/protoc /usr/local/bin/ COPY --from=build /proto/include/ /usr/local/include/ COPY --from=build /protoc-php-grpc/protoc-gen-php-grpc-1.0.0-linux-amd64/protoc-gen-php-grpc /usr/local/bin/ ADD run.sh /root/run.sh WORKDIR /app/server # Build protobuf file and start grpc server CMD ["/root/run.sh"] This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ #!/bin/sh # Build protobuf file protoc --php_out=src --php-grpc_out=src service.proto # Run grpc server if [ "$ENV" = "production" ] then rr-grpc serve else rr-grpc serve -v -d fi