fixing dockerfile
This commit is contained in:
+20
-5
@@ -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 \
|
RUN apt-get update && apt-get install -y \
|
||||||
|
curl \
|
||||||
build-essential \
|
build-essential \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
@@ -9,14 +10,28 @@ RUN apt-get update && apt-get install -y \
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY Cargo.toml Cargo.lock ./
|
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
|
FROM gcr.io/distroless/cc AS runner
|
||||||
|
|
||||||
WORKDIR /app
|
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"]
|
||||||
|
|||||||
@@ -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:
|
Ensure you have [Rust](https://www.rust-lang.org/) installed. Then, run:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cargo check
|
cargo fetch
|
||||||
```
|
```
|
||||||
|
|
||||||
4. **Run the seeders**:
|
4. **Run the seeders**:
|
||||||
@@ -92,13 +92,13 @@ For production deployment:
|
|||||||
1. **Build the Docker image**:
|
1. **Build the Docker image**:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker build -t imphnen-backend-service .
|
docker build -t imphnen-backend .
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Run the Docker container**:
|
2. **Run the Docker container**:
|
||||||
|
|
||||||
```sh
|
```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.
|
Adjust the port and environment variables as needed.
|
||||||
|
|||||||
Reference in New Issue
Block a user