diff --git a/Dockerfile b/Dockerfile index f3540e3..cd322bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ -FROM rust:1.83-slim-bullseye AS builder +FROM rust:1.85-slim-bullseye AS builder RUN apt-get update && apt-get install -y \ + curl \ build-essential \ libssl-dev \ pkg-config \ @@ -9,14 +10,28 @@ RUN apt-get update && apt-get install -y \ WORKDIR /app COPY Cargo.toml Cargo.lock ./ -COPY ./src ./src -RUN cargo build --release && strip /app/target/release/imphnen-backend-service +COPY imphnen-backend ./imphnen-backend +COPY imphnen-cms ./imphnen-cms +COPY imphnen-dimentorin ./imphnen-dimentorin +COPY imphnen-entities ./imphnen-entities +COPY imphnen-gacha ./imphnen-gacha +COPY imphnen-gateway ./imphnen-gateway +COPY imphnen-iam ./imphnen-iam +COPY imphnen-libs ./imphnen-libs +COPY imphnen-middleware ./imphnen-middleware +COPY imphnen-utils ./imphnen-utils +COPY tests ./tests + +RUN cargo fetch + +RUN cargo build -p imphnen-backend --release \ + && strip target/release/api FROM gcr.io/distroless/cc AS runner WORKDIR /app -COPY --from=builder /app/target/release/imphnen-backend-service . +COPY --from=builder /app/target/release/api . -CMD ["/app/imphnen-backend-service"] +CMD ["/app/api"] diff --git a/README.md b/README.md index 7ed5069..a0262e9 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ This repository serves as the **monorepo** for all backend services of IMPHNEN. Ensure you have [Rust](https://www.rust-lang.org/) installed. Then, run: ```sh - cargo check + cargo fetch ``` 4. **Run the seeders**: @@ -92,13 +92,13 @@ For production deployment: 1. **Build the Docker image**: ```sh - docker build -t imphnen-backend-service . + docker build -t imphnen-backend . ``` 2. **Run the Docker container**: ```sh - docker run -d --env-file .env -p 3000:3000 imphnen-backend-service + docker run -d --env-file .env -p 3000:3000 imphnen-backend ``` Adjust the port and environment variables as needed.