Skip to content

Commit

Permalink
neat others
Browse files Browse the repository at this point in the history
  • Loading branch information
feuyeux committed Oct 4, 2024
1 parent 8438d6f commit 890c70b
Show file tree
Hide file tree
Showing 57 changed files with 628 additions and 194,573 deletions.
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ updates:
directory: "hello-grpc-nodejs"
schedule:
interval: "daily"
- package-ecosystem: "yarn"
directory: "hello-grpc-ts"
schedule:
interval: "daily"
- package-ecosystem: "nuget"
directory: "hello-grpc-csharp"
schedule:
Expand All @@ -45,10 +49,6 @@ updates:
directory: "hello-grpc-swift"
schedule:
interval: "daily"
- package-ecosystem: "npm"
directory: "hello-grpc-ts"
schedule:
interval: "daily"
- package-ecosystem: "pub"
directory: "hello_grpc_flutter"
schedule:
Expand Down
14 changes: 7 additions & 7 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@

| No. | Lang | Base Image | Server | Client |
|:----|:-----------------------------|:---------------------------------------------------------------|:---------------------------------|:---------------------------------|
| 1 | [C++](hello-grpc-cpp) | | feuyeux/grpc_server_cpp:1.0.0 | feuyeux/grpc_client_cpp:1.0.0 |
| 1 | [C++](hello-grpc-cpp) | [debian:12-slim](cpp_grpc.dockerfile) | feuyeux/grpc_server_cpp:1.0.0 | feuyeux/grpc_client_cpp:1.0.0 |
| 2 | [Rust](hello-grpc-rust) | [rust:1.81-alpine3.20](rust_grpc.dockerfile) | feuyeux/grpc_server_rust:1.0.0 | feuyeux/grpc_client_rust:1.0.0 |
| 3 | [Java](hello-grpc-java) | [openjdk:23-jdk-slim](java_grpc.dockerfile) | feuyeux/grpc_server_java:1.0.0 | feuyeux/grpc_client_java:1.0.0 |
| 4 | [Go](hello-grpc-go) | [golang:1.23-alpine](go_grpc.dockerfile) | feuyeux/grpc_server_go:1.0.0 | feuyeux/grpc_client_go:1.0.0 |
| 5 | [C#](hello-grpc-csharp) | [mcr.microsoft.com/dotnet/runtime:8.0](csharp_grpc.dockerfile) | feuyeux/grpc_server_csharp:1.0.0 | feuyeux/grpc_client_csharp:1.0.0 |
| 6 | [Python](hello-grpc-python) | [python:3.11-slim](python_grpc.dockerfile) | feuyeux/grpc_server_python:1.0.0 | feuyeux/grpc_client_python:1.0.0 |
| 7 | [Node.js](hello-grpc-nodejs) | | feuyeux/grpc_server_nodejs:1.0.0 | feuyeux/grpc_client_nodejs:1.0.0 |
| 8 | [Dart](hello-grpc-dart) | | feuyeux/grpc_server_dart:1.0.0 | feuyeux/grpc_client_dart:1.0.0 |
| 9 | [Kotlin](hello-grpc-kotlin) | [openjdk:21-jdk-slim](kotlin_grpc.dockerfile) | feuyeux/grpc_server_kotlin:1.0.0 | feuyeux/grpc_client_kotlin:1.0.0 |
| 10 | [Swift](hello-grpc-swift) | | feuyeux/grpc_server_swift:1.0.0 | feuyeux/grpc_client_swift:1.0.0 |
| 11 | [PHP](hello-grpc-php) | | feuyeux/grpc_server_php:1.0.0 | feuyeux/grpc_client_php:1.0.0 |
| 12 | [TypeScript](hello-grpc-ts) | | feuyeux/grpc_server_ts:1.0.0 | feuyeux/grpc_client_ts:1.0.0 |
| 7 | [Node.js](hello-grpc-nodejs) | [node:21-alpine](node_grpc.dockerfile) | feuyeux/grpc_server_node:1.0.0 | feuyeux/grpc_client_node:1.0.0 |
| 8 | [TypeScript](hello-grpc-ts) | [node:21-alpine](ts_grpc.dockerfile) | feuyeux/grpc_server_ts:1.0.0 | feuyeux/grpc_client_ts:1.0.0 |
| 9 | [Dart](hello-grpc-dart) | [dart_grpc.dockerfile](dart_grpc.dockerfile) | feuyeux/grpc_server_dart:1.0.0 | feuyeux/grpc_client_dart:1.0.0 |
| 10 | [Kotlin](hello-grpc-kotlin) | [openjdk:21-jdk-slim](kotlin_grpc.dockerfile) | feuyeux/grpc_server_kotlin:1.0.0 | feuyeux/grpc_client_kotlin:1.0.0 |
| 11 | [Swift](hello-grpc-swift) | [swift:5.10](swift_grpc.dockerfile) | feuyeux/grpc_server_swift:1.0.0 | feuyeux/grpc_client_swift:1.0.0 |
| 12 | [PHP](hello-grpc-php) | [composer:2.8](php_grpc_base.dockerfile) | feuyeux/grpc_server_php:1.0.0 | feuyeux/grpc_client_php:1.0.0 |

## Build

Expand Down
194,000 changes: 0 additions & 194,000 deletions docker/cmake-3.29.0-rc2-linux-x86_64.sh

This file was deleted.

2 changes: 1 addition & 1 deletion docker/cpp_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cp -r hello-grpc-cpp docker/
cd docker
echo "1 build builder"
# --progress=plain
docker build -f cpp_grpc.dockerfile --target build -t feuyeux/grpc_cpp:1.0.0 .
# docker build -f cpp_grpc.dockerfile --target build -t feuyeux/grpc_cpp:1.0.0 .
# docker run --rm -it --entrypoint=bash feuyeux/grpc_cpp:1.0.0
echo "2 build server"
docker build -f cpp_grpc.dockerfile --target server -t feuyeux/grpc_server_cpp:1.0.0 .
Expand Down
2 changes: 1 addition & 1 deletion docker/csharp_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ elif [[ "${1}" == "s" ]]; then
docker build -f csharp_grpc.dockerfile --target server -t feuyeux/grpc_server_csharp:1.0.0 .
else
echo "build csharp"
docker build -f csharp_grpc.dockerfile --target build -t feuyeux/grpc_build_csharp:1.0.0 .
# docker build -f csharp_grpc.dockerfile --target build -t feuyeux/grpc_build_csharp:1.0.0 .
docker build -f csharp_grpc.dockerfile --target server -t feuyeux/grpc_server_csharp:1.0.0 .
docker build -f csharp_grpc.dockerfile --target client -t feuyeux/grpc_client_csharp:1.0.0 .
fi
Expand Down
6 changes: 3 additions & 3 deletions docker/build_dart.sh → docker/dart_build.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ cd "$(
pwd -P
)/" || exit
set -e

echo "~~~ build grpc server dart ~~~"
mkdir -p hello-grpc-dart/bin
cp -R ../hello-grpc-dart/* hello-grpc-dart
ls -htl hello-grpc-dart
docker build -f grpc-dart.dockerfile --target server -t feuyeux/grpc_server_dart:1.0.0 .
docker build -f dart_grpc.dockerfile --target server -t feuyeux/grpc_server_dart:1.0.0 .
echo

echo "~~~ build grpc client dart ~~~"
docker build -f grpc-dart.dockerfile --target client -t feuyeux/grpc_client_dart:1.0.0 .
docker build -f dart_grpc.dockerfile --target client -t feuyeux/grpc_client_dart:1.0.0 .
rm -rf hello-grpc-dart
echo
4 changes: 2 additions & 2 deletions docker/grpc-dart.dockerfile → docker/dart_grpc.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM dart:3.3.0 AS build

FROM dart:3.5 AS build
# https://hub.docker.com/_/dart
COPY hello-grpc-dart /hello-grpc
WORKDIR /hello-grpc
ENV PUB_HOSTED_URL="https://pub.flutter-io.cn"
Expand Down
3 changes: 3 additions & 0 deletions docker/dart_push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
docker push feuyeux/grpc_server_dart:1.0.0
docker push feuyeux/grpc_client_dart:1.0.0
13 changes: 13 additions & 0 deletions docker/dart_run_client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
cd "$(
cd "$(dirname "$0")" >/dev/null 2>&1
pwd -P
)/" || exit
export CLIENT_NAME=grpc_client_dart
export CLIENT_IMG=feuyeux/$CLIENT_NAME:1.0.0
# if there's first argument, it's secure, otherwise insecure
if [ "$1" = "secure" ]; then
sh run_tls_client.sh
else
sh run_insecure_client.sh
fi
13 changes: 13 additions & 0 deletions docker/dart_run_server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
cd "$(
cd "$(dirname "$0")" >/dev/null 2>&1
pwd -P
)/" || exit
export SERVER_NAME=grpc_server_dart
export SERVER_IMG=feuyeux/$SERVER_NAME:1.0.0
# if there's first argument, it's secure, otherwise insecure
if [ "$1" = "secure" ]; then
sh run_tls_server.sh
else
sh run_insecure_server.sh
fi
14 changes: 0 additions & 14 deletions docker/grpc-client-node.dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions docker/grpc-client-php.dockerfile

This file was deleted.

110 changes: 0 additions & 110 deletions docker/grpc-cpp.dockerfile

This file was deleted.

14 changes: 0 additions & 14 deletions docker/grpc-server-node.dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions docker/grpc-server-php.dockerfile

This file was deleted.

5 changes: 3 additions & 2 deletions docker/build_node.sh → docker/node_build.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ cd "$(
pwd -P
)/" || exit
set -e

echo "~~~ build grpc server node ~~~"
mkdir -p hello-grpc-nodejs
cp ../hello-grpc-nodejs/proto_server.js hello-grpc-nodejs
cp ../hello-grpc-nodejs/package.json hello-grpc-nodejs
cp -R ../hello-grpc-nodejs/common hello-grpc-nodejs
docker build -f grpc-server-node.dockerfile -t feuyeux/grpc_server_node:1.0.0 .
docker build -f node_grpc.dockerfile --target server -t feuyeux/grpc_server_node:1.0.0 .
rm -rf hello-grpc-nodejs/proto_server.js
echo

echo "~~~ build grpc client node ~~~"
cp ../hello-grpc-nodejs/*_client.js hello-grpc-nodejs
docker build -f grpc-client-node.dockerfile -t feuyeux/grpc_client_node:1.0.0 .
docker build -f node_grpc.dockerfile --target client -t feuyeux/grpc_client_node:1.0.0 .
rm -rf hello-grpc-nodejs
echo
29 changes: 29 additions & 0 deletions docker/node_grpc.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM node:21-alpine AS server
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk add --update \
python3 \
make \
g++ \
&& rm -rf /var/cache/apk/*
RUN npm config set registry https://registry.npmmirror.com && npm install -g node-pre-gyp grpc-tools --unsafe-perm
COPY tls/server_certs /var/hello_grpc/server_certs
COPY tls/client_certs /var/hello_grpc/client_certs
COPY hello-grpc-nodejs/package.json .
RUN npm install --unsafe-perm
COPY hello-grpc-nodejs .
ENTRYPOINT ["node","proto_server.js"]

FROM node:21-alpine AS client
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk add --update \
python3 \
make \
g++ \
&& rm -rf /var/cache/apk/*
RUN npm config set registry https://registry.npmmirror.com && npm install -g node-pre-gyp grpc-tools --unsafe-perm
COPY tls/client_certs /var/hello_grpc/client_certs
COPY hello-grpc-nodejs/package.json .
RUN npm install --unsafe-perm
COPY hello-grpc-nodejs .
RUN npm install --unsafe-perm
CMD ["node","proto_client.js"]
3 changes: 3 additions & 0 deletions docker/node_push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
docker push feuyeux/grpc_server_node:1.0.0
docker push feuyeux/grpc_client_node:1.0.0
13 changes: 13 additions & 0 deletions docker/node_run_client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
cd "$(
cd "$(dirname "$0")" >/dev/null 2>&1
pwd -P
)/" || exit
export CLIENT_NAME=grpc_client_node
export CLIENT_IMG=feuyeux/$CLIENT_NAME:1.0.0
# if there's first argument, it's secure, otherwise insecure
if [ "$1" = "secure" ]; then
sh run_tls_client.sh
else
sh run_insecure_client.sh
fi
13 changes: 13 additions & 0 deletions docker/node_run_server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
cd "$(
cd "$(dirname "$0")" >/dev/null 2>&1
pwd -P
)/" || exit
export SERVER_NAME=grpc_server_node
export SERVER_IMG=feuyeux/$SERVER_NAME:1.0.0
# if there's first argument, it's secure, otherwise insecure
if [ "$1" = "secure" ]; then
sh run_tls_server.sh
else
sh run_insecure_server.sh
fi
7 changes: 4 additions & 3 deletions docker/build_alpine_grpc_php.sh → docker/php_base_build.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ cd "$(
pwd -P
)/" || exit
set -e

docker images | grep composer

echo "~~~ build alpine grpc php ~~~"
docker build -f alpine-grpc-php.dockerfile -t feuyeux/grpc_php_base:1.0.0 .
docker build -f php_grpc_base.dockerfile -t feuyeux/grpc_php_base:1.0.0 .
docker run -it --rm feuyeux/grpc_php_base:1.0.0 composer --version

#build_alpine_grpc_php.sh
4 changes: 2 additions & 2 deletions docker/build_php.sh → docker/php_build.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cp ../hello-grpc-php/LandingService.php hello-grpc-php
cp ../hello-grpc-php/log4php_config.xml hello-grpc-php
cp ../hello-grpc-php/server_start.sh hello-grpc-php
cp -R ../hello-grpc-php/proto hello-grpc-php
docker build -f grpc-server-php.dockerfile -t feuyeux/grpc_server_php:1.0.0 .
docker build -f php_grpc.dockerfile --target server -t feuyeux/grpc_server_php:1.0.0 .
rm -rf hello-grpc-php/hello_server.php
rm -rf hello-grpc-php/LandingService.php
rm -rf hello-grpc-php/server_start.sh
Expand All @@ -29,7 +29,7 @@ echo
echo "~~~ build grpc client php ~~~"
cp ../hello-grpc-php/hello_client.php hello-grpc-php
cp ../hello-grpc-php/client_start.sh hello-grpc-php
docker build -f grpc-client-php.dockerfile -t feuyeux/grpc_client_php:1.0.0 .
docker build -f php_grpc.dockerfile --target client -t feuyeux/grpc_client_php:1.0.0 .
rm -rf hello-grpc-php
echo "done\n"
docker run -ti --rm feuyeux/grpc_server_php:1.0.0 cat /etc/os-release
Loading

0 comments on commit 890c70b

Please sign in to comment.