diff --git a/.gitignore b/.gitignore index c6260e93..da7cd1c8 100644 --- a/.gitignore +++ b/.gitignore @@ -168,5 +168,4 @@ chatmail.zone # docker /data/ /custom/ -docker-compose.yaml .env diff --git a/docker/docker-compose-default.yaml b/docker-compose.yaml similarity index 75% rename from docker/docker-compose-default.yaml rename to docker-compose.yaml index b5b79344..08c65673 100644 --- a/docker/docker-compose-default.yaml +++ b/docker-compose.yaml @@ -22,14 +22,14 @@ services: environment: MAIL_DOMAIN: $MAIL_DOMAIN ACME_EMAIL: $ACME_EMAIL - # RECREATE_VENV: "false" - # MAX_MESSAGE_SIZE: "50M" - # DEBUG_COMMANDS_ENABLED: "true" - # FORCE_REINIT_INI_FILE: "true" - # USE_FOREIGN_CERT_MANAGER: "True" - # ENABLE_CERTS_MONITORING: "true" - # CERTS_MONITORING_TIMEOUT: 10 - # IS_DEVELOPMENT_INSTANCE: "True" + RECREATE_VENV: $RECREATE_VENV + MAX_MESSAGE_SIZE: $MAX_MESSAGE_SIZE + DEBUG_COMMANDS_ENABLED: $DEBUG_COMMANDS_ENABLED + FORCE_REINIT_INI_FILE: $FORCE_REINIT_INI_FILE + USE_FOREIGN_CERT_MANAGER: $USE_FOREIGN_CERT_MANAGER + ENABLE_CERTS_MONITORING: $ENABLE_CERTS_MONITORING + CERTS_MONITORING_TIMEOUT: $CERTS MONITORING TIMEOUT + IS_DEVELOPMENT_INSTANCE: $IS_DEVELOPMENT_INSTANCE ports: - "80:80" - "443:443" diff --git a/docker/example.env b/docker/example.env index 48655812..e517654e 100644 --- a/docker/example.env +++ b/docker/example.env @@ -1 +1,10 @@ MAIL_DOMAIN="chat.example.com" +# ACME_EMAIL="" +# RECREATE_VENV="false" +# MAX_MESSAGE_SIZE="50M" +# DEBUG_COMMANDS_ENABLED="true" +# FORCE_REINIT_INI_FILE="true" +# USE_FOREIGN_CERT_MANAGER="True" +# ENABLE_CERTS_MONITORING="true" +# CERTS_MONITORING_TIMEOUT=10 +# IS_DEVELOPMENT_INSTANCE="True" diff --git a/docs/DOCKER_INSTALLATION_EN.md b/docs/DOCKER_INSTALLATION_EN.md index 4e32155a..5102049d 100644 --- a/docs/DOCKER_INSTALLATION_EN.md +++ b/docs/DOCKER_INSTALLATION_EN.md @@ -33,20 +33,7 @@ Please substitute it with your own domain. ## Installation -1. Copy the file `./docker/docker-compose-default.yaml` to `docker-compose.yaml`. This is necessary because `docker-compose.yaml` is in `.gitignore` and won’t cause conflicts when updating the git repository. - -```shell -cp ./docker/docker-compose-default.yaml docker-compose.yaml -``` -2. Copy `./docker/example.env` and rename it to `.env`. This file stores variables used in `docker-compose.yaml`. - -```shell -cp ./docker/example.env .env -``` - -3. Configure environment variables in the `.env` file. These variables are used in the `docker-compose.yaml` file to pass repeated values. - -4. Configure kernel parameters because they cannot be changed inside the container, specifically `fs.inotify.max_user_instances` and `fs.inotify.max_user_watches`. Run the following: +1. Configure kernel parameters because they cannot be changed inside the container, specifically `fs.inotify.max_user_instances` and `fs.inotify.max_user_watches`. Run the following: ```shell echo "fs.inotify.max_user_instances=65536" | sudo tee -a /etc/sysctl.d/99-inotify.conf @@ -54,7 +41,14 @@ echo "fs.inotify.max_user_watches=65536" | sudo tee -a /etc/sysctl.d/99-inotify. sudo sysctl --system ``` -5. Configure container environment variables. Below is the list of variables used during deployment: +2. Copy `./docker/example.env` and rename it to `.env`. This file stores variables used in `docker-compose.yaml`. + +```shell +cp ./docker/example.env .env +``` + +3. Configure environment variables in the `.env` file. These variables are used in the `docker-compose.yaml` file to pass repeated values. + Below is the list of variables used during deployment: - `MAIL_DOMAIN` – The domain name of the future server. (required) - `DEBUG_COMMANDS_ENABLED` – Run debug commands before installation. (default: `false`) @@ -68,24 +62,20 @@ sudo sysctl --system You can also use any variables from the [ini configuration file](https://github.com/chatmail/relay/blob/main/chatmaild/src/chatmaild/ini/chatmail.ini.f); they must be in uppercase. -Mandatory variables for deployment via Docker: - -- `CHANGE_KERNEL_SETTINGS` – Change kernel settings (`fs.inotify.max_user_instances` and `fs.inotify.max_user_watches`) on startup. Changing kernel settings inside the container is not possible! (default: `False`) - -6. Build the Docker image: +4. Build the Docker image: ```shell docker compose build chatmail ``` -7. Start docker compose and wait for the installation to finish: +5. Start docker compose and wait for the installation to finish: ```shell docker compose up -d # start service docker compose logs -f chatmail # view container logs, press CTRL+C to exit ``` -8. After installation is complete, you can open `https://` in your browser. +6. After installation is complete, you can open `https://` in your browser. ## Using custom files diff --git a/docs/DOCKER_INSTALLATION_RU.md b/docs/DOCKER_INSTALLATION_RU.md index 6c7409cf..fef0c29b 100644 --- a/docs/DOCKER_INSTALLATION_RU.md +++ b/docs/DOCKER_INSTALLATION_RU.md @@ -30,24 +30,21 @@ Please substitute it with your own domain. ## Installation -1. Скопировать файл `./docker/docker-compose-default.yaml` в `docker-compose.yaml`. Это нужно потому что `docker-compose.yaml` находится в `.gitignore` и не будет создавать конфликты при обновлении гит репозитория. -```shell -cp ./docker/docker-compose-default.yaml docker-compose.yaml -``` -2. Скопировать `./docker/example.env` и переименовать в `.env`. Здесь хранятся переменные, которые используются в `docker-compose.yaml`. -```shell -cp ./docker/example.env .env -```\ -3. Настроить переменные окружения в `.env` файле. Эти переменные используются в `docker-compose.yaml` файле, чтобы передавать повторяющиеся значения. - -4. Настроить параметры ядра, потому что внутри контейнера их нельзя изменить, а конкретно `fs.inotify.max_user_instances` и `fs.inotify.max_user_watches`. Для этого выполнить следующее: +1. Настроить параметры ядра, потому что внутри контейнера их нельзя изменить, а конкретно `fs.inotify.max_user_instances` и `fs.inotify.max_user_watches`. Для этого выполнить следующее: ```shell echo "fs.inotify.max_user_instances=65536" | sudo tee -a /etc/sysctl.d/99-inotify.conf echo "fs.inotify.max_user_watches=65536" | sudo tee -a /etc/sysctl.d/99-inotify.conf sudo sysctl --system ``` -5. Настроить переменные окружения контейнера. Ниже перечислен список переменных учавствующих при развертывании. +2. Скопировать `./docker/example.env` и переименовать в `.env`. Здесь хранятся переменные, которые используются в `docker-compose.yaml`. +```shell +cp ./docker/example.env .env +``` + +3. Настроить переменные окружения в `.env` файле. Эти переменные используются в `docker-compose.yaml` файле, чтобы передавать повторяющиеся значения. + Ниже перечислен список переменных учавствующих при развертывании: + - `MAIL_DOMAIN` - Доменное имя будущего сервера. (required) - `DEBUG_COMMANDS_ENABLED` - Выполнить debug команды перед установкой. (default: `false`) - `FORCE_REINIT_INI_FILE` - Пересоздавать ini файл конфигурации при запуске. (default: `false`) @@ -60,21 +57,18 @@ sudo sysctl --system Также могут быть использованы все переменные из [ini файла конфигурации](https://github.com/chatmail/relay/blob/main/chatmaild/src/chatmaild/ini/chatmail.ini.f), они обязаны быть в uppercase формате. -Ниже перечислены переменные, которые обязательны быть выставлены при развертывании через docker: -- `CHANGE_KERNEL_SETTINGS` - Менять настройки ядра (`fs.inotify.max_user_instances` и `fs.inotify.max_user_watches`) при запуске. При запуске в контейнере смена настроек ядра не может быть выполнена! (default: `False`) - -6. Собрать docker образ +4. Собрать docker образ ```shell docker compose build chatmail ``` -7. Запустить docker compose и дождаться завершения установки +5. Запустить docker compose и дождаться завершения установки ```shell docker compose up -d # запуск сервиса docker compose logs -f chatmail # просмотр логов контейнера. Для выхода нажать CTRL+C ``` -8. По окончанию установки можно открыть в браузер `https://` +6. По окончанию установки можно открыть в браузер `https://` ## Использование кастомных файлов При использовании docker есть возможность использовать измененые файлы конфигурации, чтобы сделать установку более персонализированной. Обычно это требуется для секции `www/src`, чтобы ознакомительная страница Chatmail была сделана на ваш вкус. Но также это можно использовать и для любых других случаев.