builds fix
parent
245aa9f536
commit
1281f66518
|
|
@ -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"] }
|
||||||
|
|
|
||||||
22
Dockerfile
22
Dockerfile
|
|
@ -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"]
|
||||||
|
|
@ -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:
|
||||||
|
|
|
||||||
|
|
@ -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};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue