diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..081806b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.env +.env.example +README.md +target \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..195cc8a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM rust:latest AS builder +WORKDIR /app + +RUN apt update && apt install -y musl-tools \ + pkg-config \ + libssl-dev \ + openssl +RUN rustup target add x86_64-unknown-linux-gnu + +COPY . . + +# PKG_CONFIG_PATH VAR TESTING +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 +WORKDIR /app + +COPY --from=builder /app/target/x86_64-unknown-linux-gnu/release/ml-api /app/ml-api +RUN ls /app +RUN apk add --no-cache ca-certificates + +EXPOSE 5134 + +ENTRYPOINT ["/app/ml-api"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6242df0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +services: + ollama-api: + container_name: ollama-api + image: ollama-api:dev + networks: + - ollama-api-net + environment: + - NOXIS_SOCKET_PATH=./noxis.sock + - NOXIS_PROXY_PORT=7654 + - NOXIS_LOG_LEVEL=TRACE + - ML_TARGET_URL=http://192.168.231.89:11434/api/generate + - ML_MODEL_NAME=kis-test + - ML_REQUEST_TIMEOUT=10 + - ML_LOG_LEVEL=TRACE + - ML_API_PORT=5134 + ports: + - 5134:5134 + restart: always + +networks: + ollama-api-net: + driver: bridge