fixing dockerfile

This commit is contained in:
Maulana Sodiqin
2025-05-22 22:29:28 +07:00
parent 070060365a
commit 36c12110c2
2 changed files with 23 additions and 8 deletions
+20 -5
View File
@@ -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"]
+3 -3
View File
@@ -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.