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

fix: copy default models to exposed volume on entrypoint #283

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,17 @@ ENV CODEGATE_OLLAMA_URL=http://host.docker.internal:11434
ENV CODEGATE_APP_LOG_LEVEL=WARNING
ENV CODEGATE_LOG_FORMAT=TEXT

# Copy the initial models in the image to default models
RUN mkdir -p /app/default_models && cp /app/models/* /app/default_models/

# Define volume for persistent data
VOLUME ["/app/models"]

# give the right permissions
USER root
RUN chown -R codegate /app/models
USER codegate

# Set the container's default entrypoint
EXPOSE 8989
ENTRYPOINT ["/app/scripts/entrypoint.sh"]
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@ docker run -p 8989:8989 -p 8990:80 codegate:latest
docker pull ghcr.io/stacklok/codegate/codegate:latest
docker run -p 8989:8989 -p 8990:80 ghcr.io/stacklok/codegate/codegate:latest

# With persistent data
docker run -p 8989:8989 -p 8990:80 -v /path/to/volume:/app/weaviate_data ghcr.io/stacklok/codegate/codegate:latest

# With persistent models
docker run -p 8989:8989 -p 8990:80 -v /path/to/volume:/app/models ghcr.io/stacklok/codegate/codegate:latest
```
Expand Down
2 changes: 2 additions & 0 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ start_dashboard() {

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

# Check and append additional URLs if they are set
Expand Down
Loading