From 900922f1ada57454b6456bbbc386abedbc57f58c Mon Sep 17 00:00:00 2001 From: Zwlin Date: Sun, 26 Nov 2023 21:25:44 +0800 Subject: [PATCH 1/2] feat: add Dockerfile to support using over tcp rpc --- Dockerfile | 21 +++++++++++++++++++++ docker-compose.yaml | 11 +++++++++++ 2 files changed, 32 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..055a9cf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM rust as builder + +RUN apt update && apt install -y clang librime-dev + +WORKDIR /app + +COPY . . + +RUN cargo build --release + +FROM debian:12 + +RUN apt update && apt install -y librime-dev + +WORKDIR /app + +COPY --from=builder /app/target/release/rime_ls /app + +EXPOSE 9527 + +CMD ["/app/rime_ls","--listen","0.0.0.0:9257"] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..12a343c --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,11 @@ +version: "3" + +services: + rime-ls: + restart: always + build: . + ports: + - 9257:9257 + volumes: + # mount your rime user data + - /root/.config/my_rime:/root/.local/share/rime-ls From 76c88913ea7dffcab15b75963c7a4b952c9d1e12 Mon Sep 17 00:00:00 2001 From: Zwlin Date: Mon, 27 Nov 2023 16:08:41 +0800 Subject: [PATCH 2/2] fix: Dockerfile EXPOSE port mismatch --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 055a9cf..72a6d2d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,6 @@ WORKDIR /app COPY --from=builder /app/target/release/rime_ls /app -EXPOSE 9527 +EXPOSE 9257 CMD ["/app/rime_ls","--listen","0.0.0.0:9257"]