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
|
||||
RUN cargo build --locked --release
|
||||
|
||||
FROM debian:trixie-slim AS runner
|
||||
FROM archlinux:latest AS runner
|
||||
|
||||
WORKDIR /app
|
||||
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 RUST_LOG=info
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN pacman -Syu --noconfirm ca-certificates 2>/dev/null
|
||||
|
||||
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
|
||||
|
||||
@@ -38,6 +38,8 @@ services:
|
||||
API_PORT: "3000"
|
||||
WEB_APP_URL: https://zeavisedu.asepharyana.my.id
|
||||
ML_SERVICE_URL: ${ML_SERVICE_URL:-http://zeavis-ml:8000}
|
||||
ports:
|
||||
- "3000:3000"
|
||||
labels:
|
||||
traefik.enable: "true"
|
||||
traefik.http.routers.zeavis-api.rule: Host(`api-zeavisedu.asepharyana.my.id`)
|
||||
@@ -58,6 +60,8 @@ services:
|
||||
environment:
|
||||
MODEL_PATH: /app/model/model.onnx
|
||||
MODEL_INPUT_SIZE: "224"
|
||||
ports:
|
||||
- "8000:8000"
|
||||
labels:
|
||||
traefik.enable: "true"
|
||||
traefik.http.routers.zeavis-ml.rule: Host(`ml-zeavisedu.asepharyana.my.id`)
|
||||
|
||||
Reference in New Issue
Block a user