@@ -22,15 +22,16 @@ docker run --name codegate -d -p 8989:8989 -p 9090:9090 \
22
22
23
23
CodeGate supports the following parameters:
24
24
25
- | Parameter | Default value | Description |
26
- | :----------------------- | :---------------------------------- | :----------------------------------------------------------------------------------------- |
27
- | ` CODEGATE_APP_LOG_LEVEL ` | ` WARNING ` | Sets the logging level. Valid values: ` ERROR ` , ` WARNING ` , ` INFO ` , ` DEBUG ` (case sensitive) |
28
- | ` CODEGATE_LOG_FORMAT ` | ` TEXT ` | Type of log formatting. Valid values: ` TEXT ` , ` JSON ` (case sensitive) |
29
- | ` CODEGATE_ANTHROPIC_URL ` | ` https://api.anthropic.com/v1 ` | Specifies the Anthropic engine API endpoint URL. |
30
- | ` CODEGATE_LM_STUDIO_URL ` | ` http://host.docker.internal:1234 ` | Specifies the URL of your LM Studio server. |
31
- | ` CODEGATE_OLLAMA_URL ` | ` http://host.docker.internal:11434 ` | Specifies the URL of your Ollama instance. |
32
- | ` CODEGATE_OPENAI_URL ` | ` https://api.openai.com/v1 ` | Specifies the OpenAI engine API endpoint URL. |
33
- | ` CODEGATE_VLLM_URL ` | ` http://localhost:8000 ` | Specifies the URL of the vLLM server to use. |
25
+ | Parameter | Default value | Description |
26
+ | :----------------------- | :---------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------ |
27
+ | ` CODEGATE_APP_LOG_LEVEL ` | ` WARNING ` | Sets the logging level. Valid values: ` ERROR ` , ` WARNING ` , ` INFO ` , ` DEBUG ` (case sensitive) |
28
+ | ` CODEGATE_LOG_FORMAT ` | ` TEXT ` | Type of log formatting. Valid values: ` TEXT ` , ` JSON ` (case sensitive) |
29
+ | ` CODEGATE_ANTHROPIC_URL ` | ` https://api.anthropic.com/v1 ` | Specifies the Anthropic engine API endpoint URL. |
30
+ | ` CODEGATE_LM_STUDIO_URL ` | ` http://host.docker.internal:1234 ` | Specifies the URL of your LM Studio server. |
31
+ | ` CODEGATE_OLLAMA_URL ` | ` http://host.docker.internal:11434 ` | Specifies the URL of your Ollama instance. |
32
+ | ` CODEGATE_OPENAI_URL ` | ` https://api.openai.com/v1 ` | Specifies the OpenAI engine API endpoint URL. |
33
+ | ` CODEGATE_VLLM_URL ` | ` http://localhost:8000 ` | Specifies the URL of the vLLM server to use. |
34
+ | ` DASHBOARD_BASE_API_URL ` | ` http://localhost:8989 ` | Overrides the base URL of the CodeGate API referenced by the dashboard UI (see [ run CodeGate on a remote host] ( #run-on-remote-host ) ). |
34
35
35
36
## Example: Use CodeGate with a remote Ollama server
36
37
@@ -43,55 +44,28 @@ docker run --name codegate -d -p 8989:8989 -p 9090:9090 \
43
44
--restart unless-stopped ghcr.io/stacklok/codegate
44
45
```
45
46
46
- ## Run CodeGate on a remote host
47
+ ## Example: run CodeGate on a remote host {#run-on-remote-host}
47
48
48
49
::: warning
49
50
50
- Keep security aspects in mind and run CodeGate only on a remote host within a
51
- local or otherwise secured network. CodeGate should not be run on a remote host
51
+ For security reason,s only run CodeGate on a remote host within a local or
52
+ otherwise secured/trusted network. CodeGate should not be run on a remote host
52
53
that is directly accessible from the Internet!
53
54
54
55
:::
55
56
56
- The CodeGate web dashboard provided in the Docker container expects the CodeGate
57
- API to be available on _ localhost_ port 8989. Currently this is statically set
58
- during build time and cannot be changed with a runtime configuration parameter.
57
+ The CodeGate web dashboard provided in the Docker container makes client-side
58
+ API calls from your web browser, and expects the CodeGate API to be available on
59
+ _ localhost_ port 8989 by default. To run CodeGate on a different host from your
60
+ client/browser, you can override this using the ` DASHBOARD_BASE_API_URL `
61
+ environment variable (available since CodeGate v0.1.28):
59
62
60
- Hence to run CodeGate on a remote host you need to build your own appropriately
61
- customized Docker container image from the CodeGate GitHub repository. Use the
62
- following steps as a reference and adjust them for your own setup:
63
-
64
- 1 . Clone the CodeGate GitHub repository:
65
-
66
- ``` shell
67
- git clone https://github.com/stacklok/codegate.git
68
- cd codegate
69
- ```
70
-
71
- 2 . Edit ` ./Dockerfile ` to add the ` VITE_BASE_API_URL ` environment variable
72
- _ before_ the web dashboard build step:
73
-
74
- ``` dockerfile {1-3} title="./Dockerfile"
75
- # Customize the API base URL
76
- ENV VITE_BASE_API_URL=http://<REMOTE_HOST>:8989
77
- # End customization
78
-
79
- # Install the webapp dependencies and build it
80
- RUN npm install
81
- RUN npm run build
82
- ```
83
-
84
- Replace ` <REMOTE_HOST> ` with the IP or DNS name of the remote host where
85
- CodeGate will run.
86
-
87
- 3 . Build the customized Docker image on the remote host:
88
-
89
- ``` shell
90
- make image-build
91
- ```
92
-
93
- 4 . Run the customized Docker image (built locally as ` codegate:latest ` ):
63
+ ``` bash {2}
64
+ docker run --name codegate -d -p 8989:8989 -p 9090:9090 \
65
+ -e DASHBOARD_BASE_API_URL=http://< REMOTE_HOST> :8989 \
66
+ --mount type=volume,src=codegate_volume,dst=/app/codegate_volume \
67
+ --restart unless-stopped ghcr.io/stacklok/codegate
68
+ ```
94
69
95
- ``` shell
96
- docker run --name codegate -d -p 8989:8989 -p 9090:9090 -p 8990:8990 --mount type=volume,src=codegate_volume,dst=/app/codegate_volume --restart unless-stopped codegate:latest
97
- ```
70
+ Replace ` <REMOTE_HOST> ` with the IP or DNS name of your remote CodeGate host as
71
+ reachable from your client / web browser.
0 commit comments