File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ RUN addgroup -S appgroup && adduser -S appuser -G appgroup
6
6
WORKDIR /app
7
7
8
8
ENV PUBLIC_ADAPTER='docker-node'
9
+ ENV VITE_ALLOWED_HOSTS='localhost'
9
10
10
11
COPY . .
11
12
Original file line number Diff line number Diff line change 3
3
- [ Getting started] ( #getting-started )
4
4
- [ Updating to the latest version] ( #updating-to-the-latest-version )
5
5
- [ Connecting to an Ollama server hosted elsewhere] ( #connecting-to-an-ollama-server-hosted-elsewhere )
6
+ - [ Configuring allowed hosts] ( #configuring-allowed-hosts )
6
7
7
8
## Getting started
8
9
@@ -41,3 +42,15 @@ If you are using the publicly hosted version or your Docker server is on a separ
41
42
``` bash
42
43
OLLAMA_ORIGINS=https://hollama.fernando.is ollama serve
43
44
```
45
+
46
+ ## Configuring allowed hosts
47
+
48
+ When hosting Hollama behind a reverse proxy or in a Kubernetes environment, you'll need to specify which domains are allowed to access the application. Use the ` VITE_ALLOWED_HOSTS ` environment variable to set this:
49
+
50
+ ``` shell
51
+ docker run --rm -d -p 4173:4173 \
52
+ -e VITE_ALLOWED_HOSTS=' your-domain.com,another-domain.com' \
53
+ --name hollama ghcr.io/fmaclen/hollama:latest
54
+ ```
55
+
56
+ Multiple domains can be specified by separating them with commas. If not specified, only 'localhost' will be allowed.
Original file line number Diff line number Diff line change @@ -2,5 +2,13 @@ import { sveltekit } from '@sveltejs/kit/vite';
2
2
import { defineConfig } from 'vite' ;
3
3
4
4
export default defineConfig ( {
5
- plugins : [ sveltekit ( ) ]
5
+ plugins : [ sveltekit ( ) ] ,
6
+ preview : {
7
+ // Allow all hosts in preview mode
8
+ host : true ,
9
+ // Use environment variable for allowed hosts, falling back to localhost
10
+ allowedHosts : process . env . VITE_ALLOWED_HOSTS
11
+ ? process . env . VITE_ALLOWED_HOSTS . split ( ',' )
12
+ : [ 'localhost' ]
13
+ }
6
14
} ) ;
You can’t perform that action at this time.
0 commit comments