builds fix

master
prplV 2025-06-25 10:27:26 -04:00
parent 245aa9f536
commit 1281f66518
4 changed files with 12 additions and 24 deletions

View File

@ -9,7 +9,7 @@ axum = { version = "0.8.4", features = ["ws"] }
dotenv = "0.15.0" dotenv = "0.15.0"
futures = "0.3.31" futures = "0.3.31"
lazy_static = "1.5.0" lazy_static = "1.5.0"
reqwest = { version = "0.12.20", features = ["json", "rustls-tls"] } reqwest = { version = "0.12.20", default-features = false, features = ["json", "rustls-tls"] }
serde = { version = "1.0.219", features = ["derive"] } serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140" serde_json = "1.0.140"
tokio = { version = "1.45.1", features = ["full"] } tokio = { version = "1.45.1", features = ["full"] }

View File

@ -1,27 +1,21 @@
FROM rust:latest AS builder FROM rust:alpine AS builder
RUN apk add -q --no-cache build-base curl
WORKDIR /app WORKDIR /app
RUN apt update && apt install -y musl-tools \ RUN rustup target add x86_64-unknown-linux-musl
pkg-config \
libssl-dev \
openssl
RUN rustup target add x86_64-unknown-linux-gnu
COPY . . COPY . .
# PKG_CONFIG_PATH VAR TESTING RUN cargo build --release --target=x86_64-unknown-linux-musl
ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/openssl.pc
ARG PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/openssl.pc
RUN cargo build --release --target=x86_64-unknown-linux-gnu
FROM alpine:latest FROM alpine:latest
WORKDIR /app WORKDIR /app
COPY --from=builder /app/target/x86_64-unknown-linux-gnu/release/ml-api /app/ml-api COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/ml-api /app/ml-api
RUN ls /app
RUN apk add --no-cache ca-certificates RUN apk add --no-cache ca-certificates
EXPOSE 5134 EXPOSE 5134/tcp
ENTRYPOINT ["/app/ml-api"] ENTRYPOINT ["/app/ml-api"]

View File

@ -1,7 +1,7 @@
services: services:
ollama-api: ollama-api:
container_name: ollama-api container_name: ollama-api
image: ollama-api:dev image: ollama-api:musl-dev
networks: networks:
- ollama-api-net - ollama-api-net
environment: environment:
@ -10,7 +10,7 @@ services:
- NOXIS_LOG_LEVEL=TRACE - NOXIS_LOG_LEVEL=TRACE
- ML_TARGET_URL=http://192.168.231.89:11434/api/generate - ML_TARGET_URL=http://192.168.231.89:11434/api/generate
- ML_MODEL_NAME=kis-test - ML_MODEL_NAME=kis-test
- ML_REQUEST_TIMEOUT=10 - ML_REQUEST_TIMEOUT=10
- ML_LOG_LEVEL=TRACE - ML_LOG_LEVEL=TRACE
- ML_API_PORT=5134 - ML_API_PORT=5134
ports: ports:

View File

@ -9,12 +9,6 @@ use std::sync::Arc;
type Config = Arc<ApiSessionConfig>; type Config = Arc<ApiSessionConfig>;
pub mod openapi {
use super::{IntoResponse, StatusCode};
pub async fn swagger() -> impl IntoResponse { (StatusCode::NOT_IMPLEMENTED, "still in development ...") }
}
pub mod rest { pub mod rest {
use tracing::trace; use tracing::trace;
use super::{IntoResponse, StatusCode, InputMetric, Json, Config, State}; use super::{IntoResponse, StatusCode, InputMetric, Json, Config, State};