From c9dbc79f756e4f8f1a7edc26cd725ed6d2e5ca8f Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Thu, 27 Feb 2025 15:55:50 +0800 Subject: [PATCH] Add Docker environment variables documentation - Update environment-variables.mdx with Docker-specific environment variable guidance - Add environment variable sections to docker-development.mdx and docker.mdx - Provide instructions for updating environment variables in Docker containers - Include a warning about properly recreating containers when changing environment variables --- docs/configuration/environment-variables.mdx | 26 +++++++++++++++++++- docs/deployment/docker-development.mdx | 6 ++++- docs/deployment/docker.mdx | 4 +++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/docs/configuration/environment-variables.mdx b/docs/configuration/environment-variables.mdx index 6b82eb46..f42f2bf8 100644 --- a/docs/configuration/environment-variables.mdx +++ b/docs/configuration/environment-variables.mdx @@ -65,4 +65,28 @@ There are dedicated configuration pages available for more detailed setup instru import CloudVersion from "/snippets/cloud-version.mdx"; - \ No newline at end of file + + +## Docker Environment Variables + +When running OpnForm with Docker, there are some important considerations for handling environment variables: + +### Updating Environment Variables + +When changing environment variables in your `.env` files, you need to recreate the containers for the changes to take effect. Simply restarting the containers is not sufficient as Docker only loads environment variables when containers are created. + +To apply new environment variable changes: + +```bash +# For a specific service (e.g., ui) +docker compose down ui +docker compose up -d ui + +# For all services +docker compose down +docker compose up -d +``` + + +A simple `docker compose restart` will not reload environment variables from your `.env` files. You must use `down` and `up` commands to recreate the containers. + \ No newline at end of file diff --git a/docs/deployment/docker-development.mdx b/docs/deployment/docker-development.mdx index bb473d60..37650aa1 100644 --- a/docs/deployment/docker-development.mdx +++ b/docs/deployment/docker-development.mdx @@ -183,4 +183,8 @@ If hot reload isn't working: 3. Try restarting the UI container: ```bash docker compose -f docker-compose.dev.yml restart ui - ``` \ No newline at end of file + ``` + +## Environment Variables + +For detailed information about environment variables and how to update them in Docker, see our [Environment Variables](/configuration/environment-variables#docker-environment-variables) documentation. \ No newline at end of file diff --git a/docs/deployment/docker.mdx b/docs/deployment/docker.mdx index da15ddd0..f5df0ccf 100644 --- a/docs/deployment/docker.mdx +++ b/docs/deployment/docker.mdx @@ -135,6 +135,10 @@ services: - ./custom-nginx.conf:/etc/nginx/conf.d/default.conf ``` +## Environment Variables + +For detailed information about environment variables and how to update them in Docker, see our [Environment Variables](/configuration/environment-variables#docker-environment-variables) documentation. + ## Maintenance ### Updates