Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 5ec0b4f

Browse files
authored
chore: update docker readme (#1553)
Co-authored-by: Hien To <tominhhien97@gmail.com>
1 parent 8ca2012 commit 5ec0b4f

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

docker/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ FROM ubuntu:22.04 as base
22

33
FROM base as build
44

5+
ARG CORTEX_CPP_VERSION=latest
6+
57
ENV DEBIAN_FRONTEND=noninteractive
68

79
# Install dependencies
@@ -41,9 +43,11 @@ RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/nul
4143

4244
WORKDIR /app
4345

44-
COPY . /app/
46+
COPY ./engine /app/engine
47+
48+
COPY ./docs/static/openapi/cortex.json /app/docs/static/openapi/cortex.json
4549

46-
RUN git submodule update --init && cd engine && make configure-vcpkg && make build CMAKE_EXTRA_FLAGS="-DCORTEX_CPP_VERSION=$(git rev-parse HEAD) -DCMAKE_BUILD_TEST=OFF -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
50+
RUN cd engine && make configure-vcpkg && make build CMAKE_EXTRA_FLAGS="-DCORTEX_CPP_VERSION=${CORTEX_CPP_VERSION} -DCMAKE_BUILD_TEST=OFF -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
4751

4852
FROM base as runtime
4953

@@ -74,6 +78,8 @@ RUN chmod +x /tmp/download-cortex.llamacpp.sh && /bin/bash /tmp/download-cortex.
7478
# Copy the entrypoint script
7579
COPY ./docker/entrypoint.sh /usr/local/bin/entrypoint.sh
7680

81+
RUN chmod +x /usr/local/bin/entrypoint.sh
82+
7783
EXPOSE 39281
7884

7985
HEALTHCHECK --interval=300s --timeout=30s --start-period=10s --retries=3 \

docker/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ This guide will help you set up and run Cortex using Docker.
1010
1. Clone the Cortex repository
1111
```bash
1212
git clone https://github.com/janhq/cortex.cpp.git
13-
1413
cd cortex.cpp
14+
git submodule update --init
1515
```
1616
2. Build the Docker image
1717
```bash
1818
# Default always uses the latest cortex.cpp and cortex.llamacpp
19-
docker build -t cortex -f docker/Dockerfile .
19+
docker build -t cortex --build-arg CORTEX_CPP_VERSION=$(git rev-parse HEAD) -f docker/Dockerfile .
2020
2121
# Use specific version of cortex.cpp and cortex.llamacpp
22-
docker build --build-arg CORTEX_LLAMACPP_VERSION=0.1.34 -t cortex -f docker/Dockerfile .
22+
docker build --build-arg CORTEX_LLAMACPP_VERSION=0.1.34 --build-arg CORTEX_CPP_VERSION=$(git rev-parse HEAD) -t cortex -f docker/Dockerfile .
2323
```
2424

2525
3. Run the Docker container

0 commit comments

Comments
 (0)