Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial grpc support #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(CI) add local dockerfile
  • Loading branch information
rupansh committed Jul 12, 2024
commit 5dd7d832bb2ee8d303c355398286fadba9541fe5
35 changes: 35 additions & 0 deletions Dockerfile.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM clux/muslrust:stable AS chef
USER root
RUN cargo install cargo-chef
WORKDIR /app

FROM chef as planner

WORKDIR /app
COPY . .
RUN cargo chef prepare --recipe-path recipe.json

FROM chef as build

WORKDIR /app

COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json
RUN apt-get update && apt-get install -y protobuf-compiler --no-install-recommends && \
rm -rf /var/lib/apt/lists/*


COPY . .

RUN ./build-server.sh

FROM redis:alpine as runner

WORKDIR /app

COPY --from=build /app/target/x86_64-unknown-linux-musl/release/yral-metadata-server .
COPY ./config.docker.toml config.toml
COPY ./docker-run.sh .
ENV RUST_LOG debug

CMD ["./docker-run.sh"]
2 changes: 1 addition & 1 deletion build-server.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

cd server && cargo build --release --target x86_64-unknown-linux-musl
cd server && cargo build --release --target x86_64-unknown-linux-musl
6 changes: 6 additions & 0 deletions config.docker.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bind_address = "0.0.0.0:8000"
legacy_bind_address = "0.0.0.0:8001"
redis_url = "redis://127.0.0.1:6379"
jwt_public_key = """-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEA+7sElHIjIrCJeIMAWr1qN8vt/r1iuGmZDUR9mn7itq0=
-----END PUBLIC KEY-----"""
4 changes: 4 additions & 0 deletions docker-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

redis-server --daemonize yes
./yral-metadata-server
Loading