You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dynamically create the service_conf.yaml file by replacing environment variables from .env (infiniflow#3341)
### What problem does this PR solve?
This pull request implements the feature mentioned in infiniflow#3322.
Instead of manually having to edit the `service_conf.yaml` file when
changes have been made to `.env` and mapping it into the docker
container at runtime, a template file is used and the values replaced by
the environment variables from the `.env` file when the container is
started.
### Type of change
- [X] New Feature (non-breaking change which adds functionality)
---------
Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
Co-authored-by: Zhichang Yu <yuzhichang@gmail.com>
Copy file name to clipboardExpand all lines: README.md
+6-11Lines changed: 6 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -216,7 +216,7 @@ releases! 🌟
216
216
5. In your web browser, enter the IP address of your server and log in to RAGFlow.
217
217
> With the default settings, you only need to enter `http://IP_OF_YOUR_MACHINE` (**sans** port number) as the default
218
218
HTTP serving port `80` can be omitted when using the default configurations.
219
-
6. In [service_conf.yaml](./docker/service_conf.yaml), selectthe desired LLM factory in`user_default_llm` and update
219
+
6. In [service_conf.yaml.template](./docker/service_conf.yaml.template), selectthe desired LLM factory in`user_default_llm` and update
220
220
the `API_KEY` field with the corresponding API key.
221
221
222
222
> See [llm_api_key_setup](https://ragflow.io/docs/dev/llm_api_key_setup) for more information.
@@ -229,16 +229,11 @@ When it comes to system configurations, you will need to manage the following fi
229
229
230
230
- [.env](./docker/.env): Keeps the fundamental setups for the system, such as `SVR_HTTP_PORT`, `MYSQL_PASSWORD`, and
231
231
`MINIO_PASSWORD`.
232
-
- [service_conf.yaml](./docker/service_conf.yaml): Configures the back-end services.
233
-
- [docker-compose.yml](./docker/docker-compose.yml): The system relies
234
-
on [docker-compose.yml](./docker/docker-compose.yml) to start up.
235
-
236
-
You must ensure that changes to the [.env](./docker/.env) file are in line with what are in the [service_conf.yaml](./docker/service_conf.yaml) file.
232
+
- [service_conf.yaml.template](./docker/service_conf.yaml.template): Configures the back-end services. The environment variables in this file will be automatically populated when the Docker container starts. Any environment variables set within the Docker container will be available for use, allowing you to customize service behavior based on the deployment environment.
233
+
- [docker-compose.yml](./docker/docker-compose.yml): The system relies on [docker-compose.yml](./docker/docker-compose.yml) to start up.
237
234
238
235
> The [./docker/README](./docker/README.md) file provides a detailed description of the environment settings and service
239
-
> configurations, and you are REQUIRED to ensure that all environment settings listed in
240
-
> the [./docker/README](./docker/README.md) file are aligned with the corresponding configurations in
241
-
> the [service_conf.yaml](./docker/service_conf.yaml) file.
236
+
> configurations which can be used as `${ENV_VARS}`in the [service_conf.yaml.template](./docker/service_conf.yaml.template) file.
242
237
243
238
To update the default HTTP serving port (80), go to [docker-compose.yml](./docker/docker-compose.yml) and change `80:80`
Copy file name to clipboardExpand all lines: docker/README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ The [.env](./.env) file contains important environment variables for Docker.
27
27
-`ES_PORT`
28
28
The port used to expose the Elasticsearch service to the host machine, allowing **external** access to the service running inside the Docker container. Defaults to `1200`.
29
29
-`ELASTIC_PASSWORD`
30
-
The password for Elasticsearch. When updated, you must revise the `es.password` entry in [service_conf.yaml](./service_conf.yaml) accordingly.
30
+
The password for Elasticsearch.
31
31
32
32
### Kibana
33
33
@@ -46,7 +46,7 @@ The [.env](./.env) file contains important environment variables for Docker.
46
46
### MySQL
47
47
48
48
-`MYSQL_PASSWORD`
49
-
The password for MySQL. When updated, you must revise the `mysql.password` entry in [service_conf.yaml](./service_conf.yaml) accordingly.
49
+
The password for MySQL.
50
50
-`MYSQL_PORT`
51
51
The port used to expose the MySQL service to the host machine, allowing **external** access to the MySQL database running inside the Docker container. Defaults to `5455`.
52
52
@@ -57,16 +57,16 @@ The [.env](./.env) file contains important environment variables for Docker.
57
57
-`MINIO_PORT`
58
58
The port used to expose the MinIO API service to the host machine, allowing **external** access to the MinIO object storage service running inside the Docker container. Defaults to `9000`.
59
59
-`MINIO_USER`
60
-
The username for MinIO. When updated, you must revise the `minio.user` entry in [service_conf.yaml](./service_conf.yaml) accordingly.
60
+
The username for MinIO.
61
61
-`MINIO_PASSWORD`
62
-
The password for MinIO. When updated, you must revise the `minio.password` entry in [service_conf.yaml](./service_conf.yaml) accordingly.
62
+
The password for MinIO.
63
63
64
64
### Redis
65
65
66
66
-`REDIS_PORT`
67
67
The port used to expose the Redis service to the host machine, allowing **external** access to the Redis service running inside the Docker container. Defaults to `6379`.
68
68
-`REDIS_PASSWORD`
69
-
The password for Redis. When updated, you must revise the `redis.password` entry in [service_conf.yaml](./service_conf.yaml) accordingly.
69
+
The password for Redis.
70
70
71
71
### RAGFlow
72
72
@@ -119,7 +119,7 @@ The [.env](./.env) file contains important environment variables for Docker.
119
119
120
120
## 🐋 Service configuration
121
121
122
-
[service_conf.yaml](./service_conf.yaml) specifies the system-level configuration for RAGFlow and is used by its API server and task executor.
122
+
[service_conf.yaml](./service_conf.yaml) specifies the system-level configuration for RAGFlow and is used by its API server and task executor. In a dockerized setup, this file is automatically created based on the [service_conf.yaml.template](./service_conf.yaml.template) file (replacing all environment variables by their values).
123
123
124
124
-`ragflow`
125
125
-`host`: The API server's IP address inside the Docker container. Defaults to `0.0.0.0`.
@@ -139,11 +139,11 @@ The [.env](./.env) file contains important environment variables for Docker.
139
139
-`host`: The MinIO serving IP *and* port inside the Docker container. Defaults to `minio:9000`.
140
140
141
141
-`oauth`
142
-
The OAuth configuration for signing up or signing in to RAGFlow using a third-party account. It is disabled by default. To enable this feature, uncomment the corresponding lines in **service_conf.yaml**.
142
+
The OAuth configuration for signing up or signing in to RAGFlow using a third-party account. It is disabled by default. To enable this feature, uncomment the corresponding lines in **service_conf.yaml.template**.
143
143
-`github`: The GitHub authentication settings for your application. Visit the [Github Developer Settings page](https://github.com/settings/developers) to obtain your client_id and secret_key.
144
144
145
145
-`user_default_llm`
146
-
The default LLM to use for a new RAGFlow user. It is disabled by default. To enable this feature, uncomment the corresponding lines in **service_conf.yaml**.
146
+
The default LLM to use for a new RAGFlow user. It is disabled by default. To enable this feature, uncomment the corresponding lines in **service_conf.yaml.template**.
Copy file name to clipboardExpand all lines: docs/configurations.md
+9-11Lines changed: 9 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,9 @@ Configurations for installing RAGFlow via Docker.
12
12
When it comes to system configurations, you will need to manage the following files:
13
13
14
14
-[.env](https://github.com/infiniflow/ragflow/blob/main/docker/.env): Contains important environment variables for Docker.
15
-
-[service_conf.yaml](https://github.com/infiniflow/ragflow/blob/main/docker/service_conf.yaml): Configures the back-end services. It specifies the system-level configuration for RAGFlow and is used by its API server and task executor.
15
+
-[service_conf.yaml.template](https://github.com/infiniflow/ragflow/blob/main/docker/service_conf.yaml.template): Configures the back-end services. It specifies the system-level configuration for RAGFlow and is used by its API server and task executor. Upon container startup, the `service_conf.yaml` file will be generated based on this template file. This process replaces any environment variables within the template, allowing for dynamic configuration tailored to the container's environment.
16
16
-[docker-compose.yml](https://github.com/infiniflow/ragflow/blob/main/docker/docker-compose.yml): The Docker Compose file for starting up the RAGFlow service.
17
17
18
-
You must ensure that changes to the [.env](https://github.com/infiniflow/ragflow/blob/main/docker/.env) file are in line with what are in the [service_conf.yaml](https://github.com/infiniflow/ragflow/blob/main/docker/service_conf.yaml) file.
19
-
20
18
To update the default HTTP serving port (80), go to [docker-compose.yml](./docker/docker-compose.yml) and change `80:80`
21
19
to `<YOUR_SERVING_PORT>:80`.
22
20
@@ -47,7 +45,7 @@ The [.env](https://github.com/infiniflow/ragflow/blob/main/docker/.env) file con
47
45
-`ES_PORT`
48
46
The port used to expose the Elasticsearch service to the host machine, allowing **external** access to the service running inside the Docker container. Defaults to `1200`.
49
47
-`ELASTIC_PASSWORD`
50
-
The password for Elasticsearch. When updated, you must revise the `es.password` entry in [service_conf.yaml](https://github.com/infiniflow/ragflow/blob/main/docker/service_conf.yaml) accordingly.
48
+
The password for Elasticsearch.
51
49
52
50
### Kibana
53
51
@@ -66,7 +64,7 @@ The [.env](https://github.com/infiniflow/ragflow/blob/main/docker/.env) file con
66
64
### MySQL
67
65
68
66
-`MYSQL_PASSWORD`
69
-
The password for MySQL. When updated, you must revise the `mysql.password` entry in [service_conf.yaml](https://github.com/infiniflow/ragflow/blob/main/docker/service_conf.yaml) accordingly.
67
+
The password for MySQL.
70
68
-`MYSQL_PORT`
71
69
The port used to expose the MySQL service to the host machine, allowing **external** access to the MySQL database running inside the Docker container. Defaults to `5455`.
72
70
@@ -77,16 +75,16 @@ The [.env](https://github.com/infiniflow/ragflow/blob/main/docker/.env) file con
77
75
-`MINIO_PORT`
78
76
The port used to expose the MinIO API service to the host machine, allowing **external** access to the MinIO object storage service running inside the Docker container. Defaults to `9000`.
79
77
-`MINIO_USER`
80
-
The username for MinIO. When updated, you must revise the `minio.user` entry in [service_conf.yaml](https://github.com/infiniflow/ragflow/blob/main/docker/service_conf.yaml) accordingly.
78
+
The username for MinIO.
81
79
-`MINIO_PASSWORD`
82
-
The password for MinIO. When updated, you must revise the `minio.password` entry in [service_conf.yaml](https://github.com/infiniflow/ragflow/blob/main/docker/service_conf.yaml)accordingly.
80
+
The password for MinIO. accordingly.
83
81
84
82
### Redis
85
83
86
84
-`REDIS_PORT`
87
85
The port used to expose the Redis service to the host machine, allowing **external** access to the Redis service running inside the Docker container. Defaults to `6379`.
88
86
-`REDIS_PASSWORD`
89
-
The password for Redis. When updated, you must revise the `redis.password` entry in [service_conf.yaml](https://github.com/infiniflow/ragflow/blob/main/docker/service_conf.yaml) accordingly.
87
+
The password for Redis.
90
88
91
89
### RAGFlow
92
90
@@ -140,7 +138,7 @@ If you cannot download the RAGFlow Docker image, try the following mirrors.
140
138
141
139
## Service configuration
142
140
143
-
[service_conf.yaml](https://github.com/infiniflow/ragflow/blob/main/docker/service_conf.yaml) specifies the system-level configuration for RAGFlow and is used by its API server and task executor.
141
+
[service_conf.yaml.template](https://github.com/infiniflow/ragflow/blob/main/docker/service_conf.yaml.template) specifies the system-level configuration for RAGFlow and is used by its API server and task executor.
144
142
145
143
### `ragflow`
146
144
@@ -164,13 +162,13 @@ If you cannot download the RAGFlow Docker image, try the following mirrors.
164
162
165
163
### `oauth`
166
164
167
-
The OAuth configuration for signing up or signing in to RAGFlow using a third-party account. It is disabled by default. To enable this feature, uncomment the corresponding lines in **service_conf.yaml**.
165
+
The OAuth configuration for signing up or signing in to RAGFlow using a third-party account. It is disabled by default. To enable this feature, uncomment the corresponding lines in **service_conf.yaml.template**.
168
166
169
167
-`github`: The GitHub authentication settings for your application. Visit the [Github Developer Settings](https://github.com/settings/developers) page to obtain your client_id and secret_key.
170
168
171
169
### `user_default_llm`
172
170
173
-
The default LLM to use for a new RAGFlow user. It is disabled by default. To enable this feature, uncomment the corresponding lines in **service_conf.yaml**.
171
+
The default LLM to use for a new RAGFlow user. It is disabled by default. To enable this feature, uncomment the corresponding lines in **service_conf.yaml.template**.
0 commit comments