<commit_before># SlideWiki Production Deployment

SlideWiki is an application that build on the principles of microservice architectures. The individual parts of the SlideWiki microservice architecture are realized as [Docker](https://www.docker.com/) containers. SlideWiki uses the [Docker Compose](https://docs.docker.com/compose/overview/) tool for deployment. 


## Preparing for Deplyoment

This section explains the configurtion necessary for starting a SlideWiki deployment the first time.


### Basic configuration (.env file)

The `.env` file holds the basic configuration of the SlideWiki deployment. It defines environment variables use in the docker-compose to configure the system. In general it should be sufficient only to conigure this file, changes to the compose files are only necessary when the structure of the deployment needs to be changed. In the following the individual variables will be explained:

- `SLIDEWIKI_VERSION` the version of SlideWiki to run. This determines which Docker images are use (== Tag on Docker Hub).
- `BASE_DOMAIN` sets base domain for your deployment. The Platform will be accessible under this name. The microservice will be accessible under `<service>.BASE_DOMAIN` (e.g. deckservice.mydomain.com, userservice.mydomain.com etc.).
- `LETSENCRYPT_EMAIL` email address for automatic LetsEncrypt certification. 
- `LETSENCRYPT_TEST` if set to true the LetsEncrypt certification will only pull self-signed certificates. This is handy for testing purposes as this doesn't impact the LetsEncrypt certificate limits for your domain.
- `RECAPTCHA_PRIVATE_KEY` private key for ReCaptcha.
- `RECAPTCHA_PUBLIC_KEY` public key for ReCaptacha.
- `API_KEY` SlideWiki API key used for communication between Platform and User Service.
- `JWT_SERIAL` JWT Ssrial for services
- `SMTP_FROM` email address used when SlideWiki sends out registration/password reset mails.
- `SMTP_HOST`, `SMTP_PORT`, `SMTP_CLIENTNAME` hostname, port of SMTP server to use when sending mails and FQDN of sending machine (optional).
- `MAINTENANCE_DIR` directory where the backups are stored and served from (`MAINTENACE_DIR/(db|files)`). By default the logger is configured to store the logs under `MAINTENACE_DIR/log` so they are also accessible via HTTP.

### Instance Name

The `instance_name` file holds the project prefix for docker-compose. The default value is `slidewiki`. You can change it e.g. for test purposes and make the deployment use netwroks and volumes with the changed prefix, leaving your original instance untouched.

Example:
```<commit_msg>fixed typos in README<commit_after># SlideWiki Production Deployment

SlideWiki is an application that build on the principles of microservice architectures. The individual parts of the SlideWiki microservice architecture are realized as [Docker](https://www.docker.com/) containers. SlideWiki uses the [Docker Compose](https://docs.docker.com/compose/overview/) tool for deployment. 


## Preparing for Deplyoment

This section explains the configurtion necessary for starting a SlideWiki deployment the first time.


### Basic configuration (.env file)

The `.env` file holds the basic configuration of the SlideWiki deployment. It defines environment variables used in the docker-compose to configure the system. In general it should be sufficient only to configure this file, changes to the compose files are only necessary when the structure of the deployment needs to be changed. In the following the individual variables will be explained:

- `SLIDEWIKI_VERSION` the version of SlideWiki to run. This determines which Docker images are use (== Tag on Docker Hub).
- `BASE_DOMAIN` sets base domain for your deployment. The Platform will be accessible under this name. The microservice will be accessible under `<service>.BASE_DOMAIN` (e.g. deckservice.mydomain.com, userservice.mydomain.com etc.).
- `LETSENCRYPT_EMAIL` email address for automatic LetsEncrypt certification. 
- `LETSENCRYPT_TEST` if set to true the LetsEncrypt certification will only pull self-signed certificates. This is handy for testing purposes as this doesn't impact the LetsEncrypt certificate limits for your domain.
- `RECAPTCHA_PRIVATE_KEY` private key for ReCaptcha.
- `RECAPTCHA_PUBLIC_KEY` public key for ReCaptacha.
- `API_KEY` SlideWiki API key used for communication between Platform and User Service.
- `JWT_SERIAL` JWT Ssrial for services
- `SMTP_FROM` email address used when SlideWiki sends out registration/password reset mails.
- `SMTP_HOST`, `SMTP_PORT`, `SMTP_CLIENTNAME` hostname, port of SMTP server to use when sending mails and FQDN of sending machine (optional).
- `MAINTENANCE_DIR` directory where the backups are stored and served from (`MAINTENACE_DIR/(db|files)`). By default the logger is configured to store the logs under `MAINTENACE_DIR/log` so they are also accessible via HTTP.

### Instance Name

The `instance_name` file holds the project prefix for docker-compose. The default value is `slidewiki`. You can change it e.g. for test purposes and make the deployment use netwroks and volumes with the changed prefix, leaving your original instance untouched.

Example:
```
{'fraction_non_alphanumeric': 0.060077519379844964, 'fraction_numerical': 0.0, 'mean_word_length': 5.0717647058823525, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1273720', 'n_tokens_mistral': 1388, 'n_tokens_neox': 1339, 'n_words': 661}