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

Commit 65da10d

Browse files
authored
Merge pull request #283 from stacklok/fix_models
fix: copy default models to exposed volume on entrypoint
2 parents d58e9b3 + 76ec519 commit 65da10d

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,17 @@ ENV CODEGATE_OLLAMA_URL=http://host.docker.internal:11434
106106
ENV CODEGATE_APP_LOG_LEVEL=WARNING
107107
ENV CODEGATE_LOG_FORMAT=TEXT
108108

109+
# Copy the initial models in the image to default models
110+
RUN mkdir -p /app/default_models && cp /app/models/* /app/default_models/
111+
109112
# Define volume for persistent data
110113
VOLUME ["/app/models"]
111114

115+
# give the right permissions
116+
USER root
117+
RUN chown -R codegate /app/models
118+
USER codegate
119+
112120
# Set the container's default entrypoint
113121
EXPOSE 8989
114122
ENTRYPOINT ["/app/scripts/entrypoint.sh"]

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ docker run -p 8989:8989 -p 8990:80 codegate:latest
157157
docker pull ghcr.io/stacklok/codegate/codegate:latest
158158
docker run -p 8989:8989 -p 8990:80 ghcr.io/stacklok/codegate/codegate:latest
159159

160-
# With persistent data
161-
docker run -p 8989:8989 -p 8990:80 -v /path/to/volume:/app/weaviate_data ghcr.io/stacklok/codegate/codegate:latest
162-
163160
# With persistent models
164161
docker run -p 8989:8989 -p 8990:80 -v /path/to/volume:/app/models ghcr.io/stacklok/codegate/codegate:latest
165162
```

scripts/entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ start_dashboard() {
2929

3030
# Function to start the main application
3131
start_application() {
32+
# first restore the models
33+
cp /app/default_models/* /app/models/
3234
CMD_ARGS="--port 8989 --host 0.0.0.0 --vllm-url $CODEGATE_VLLM_URL --model-base-path $MODEL_BASE_PATH"
3335

3436
# Check and append additional URLs if they are set

0 commit comments

Comments
 (0)