feat: update ML service Dockerfile to archlinux base and add port bindings for api/ml metrics
This commit is contained in:
@@ -5,7 +5,7 @@ COPY apps/ml-service/Cargo.toml apps/ml-service/Cargo.lock ./
|
|||||||
COPY apps/ml-service/src ./src
|
COPY apps/ml-service/src ./src
|
||||||
RUN cargo build --locked --release
|
RUN cargo build --locked --release
|
||||||
|
|
||||||
FROM debian:trixie-slim AS runner
|
FROM archlinux:latest AS runner
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV MODEL_PATH=/app/model/model.onnx
|
ENV MODEL_PATH=/app/model/model.onnx
|
||||||
@@ -14,9 +14,7 @@ ENV ML_SERVICE_HOST=0.0.0.0
|
|||||||
ENV ML_SERVICE_PORT=8000
|
ENV ML_SERVICE_PORT=8000
|
||||||
ENV RUST_LOG=info
|
ENV RUST_LOG=info
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN pacman -Syu --noconfirm ca-certificates 2>/dev/null
|
||||||
&& apt-get install -y --no-install-recommends ca-certificates \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
COPY --from=builder /app/target/release/zeavis-ml-service /usr/local/bin/zeavis-ml-service
|
COPY --from=builder /app/target/release/zeavis-ml-service /usr/local/bin/zeavis-ml-service
|
||||||
COPY Machine_Learning/model/model.onnx /app/model/model.onnx
|
COPY Machine_Learning/model/model.onnx /app/model/model.onnx
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ services:
|
|||||||
API_PORT: "3000"
|
API_PORT: "3000"
|
||||||
WEB_APP_URL: https://zeavisedu.asepharyana.my.id
|
WEB_APP_URL: https://zeavisedu.asepharyana.my.id
|
||||||
ML_SERVICE_URL: ${ML_SERVICE_URL:-http://zeavis-ml:8000}
|
ML_SERVICE_URL: ${ML_SERVICE_URL:-http://zeavis-ml:8000}
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
labels:
|
labels:
|
||||||
traefik.enable: "true"
|
traefik.enable: "true"
|
||||||
traefik.http.routers.zeavis-api.rule: Host(`api-zeavisedu.asepharyana.my.id`)
|
traefik.http.routers.zeavis-api.rule: Host(`api-zeavisedu.asepharyana.my.id`)
|
||||||
@@ -58,6 +60,8 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
MODEL_PATH: /app/model/model.onnx
|
MODEL_PATH: /app/model/model.onnx
|
||||||
MODEL_INPUT_SIZE: "224"
|
MODEL_INPUT_SIZE: "224"
|
||||||
|
ports:
|
||||||
|
- "8000:8000"
|
||||||
labels:
|
labels:
|
||||||
traefik.enable: "true"
|
traefik.enable: "true"
|
||||||
traefik.http.routers.zeavis-ml.rule: Host(`ml-zeavisedu.asepharyana.my.id`)
|
traefik.http.routers.zeavis-ml.rule: Host(`ml-zeavisedu.asepharyana.my.id`)
|
||||||
|
|||||||
Reference in New Issue
Block a user