Commit 3674c95a authored by Nils Mittler's avatar Nils Mittler 🕵🏼
Browse files

Begin documentation

parent c1f0cfcf
# frag.jetzt Docker Orchestration
This repository contains everything the frag.jetzt backend requires to run and organize everything by using Docker:
- Configuration for Docker Compose
- Dockerfiles (and additional assets) to create modified versions of thirdparty images and enable plugins etc.
[frag.jetzt](https://frag.jetzt/) consists of several parts and requires certain dependencies to run correctly. This repository contains configuration files and scripts to simplify application setup with Docker and Docker Compose for both development and production purposes.
# Preparations for Windows
## Whats included?
**We strongly recommend that you use Linux!** If you still want to use Windows, follow these instructions for setting up docker on windows: [frag.jetzt - Installing Docker on Windows via WSL 2](./docker_win_readme.md). But be warned: despite many optimizations, frag.jetzt doesn't run nearly as fast on Windows as it does on Linux!
The following parts are included by default and can be configured individually.
# Usage
1. [frag.jetzt (Frontend)](https://git.thm.de/arsnova/frag.jetzt)
2. [frag.jetzt (Backend)](https://git.thm.de/arsnova/frag.jetzt-backend)
3. [frag.jetzt (Websocket Gateway)](https://git.thm.de/arsnova/arsnova-ws-gateway)
4. [RabbitMQ (Message Broker)](https://hub.docker.com/_/rabbitmq)
5. [PostgreSQL (Database)](https://hub.docker.com/_/postgres)
6. Email Service (Depending on configuration)
1. [Mailhog (E-Mail Testing, for development)](https://hub.docker.com/r/mailhog/mailhog)
2. [Postfix (E-Mail Server, for production)](https://hub.docker.com/r/danilsmirnov/postfix)
## Requirements
### Mandatory Requirements
1. GNU/Linux compliant operating system, for example:
1. Debian based: Debian, Ubuntu, Mint, ...
2. Arch based: Arch, Manjaro, ...
3. Red Hat based: Red Hat, RHEL, Fedora, CentOS, ...
4. ...
2. Docker
1. [Installation Instructions](https://docs.docker.com/engine/install/)
2. [Docker Reference](https://docs.docker.com/reference/)
3. Docker Compose
1. [Installation Instructions](https://docs.docker.com/compose/install/)
2. [Docker Compose Reference](https://docs.docker.com/compose/reference/)
### Optional requirements
1. If you would like to make use of DeepL API, you will need an DeepL Auth Key
1. [Accessing the API](https://www.deepl.com/docs-api/accessing-the-api/)
2. Although specifying the key is optional, AI supported text enhancement will not work without specifying the key.
2. If you would like to setup the application for production, you will need at least
1. A fully qualified domain name (FQDN)
2. A ssl key pair (private & public key)
3. openssl
### Other OS's
<strong style="color: red;">We strongly recommend that you use a GNU/Linux compliant OS!</strong>
If you still want to use Windows, follow these instructions for setting up docker on windows: [frag.jetzt - Installing Docker on Windows via WSL 2](./docker_win_readme.md).
If you still want to use MacOS, you need to install the GNU Core Utilities package.
**Be warned: despite many optimizations, frag.jetzt doesn't run nearly as fast on Windows or MacOS as it does on a GNU/Linux OS!**
## Usage
## Preparations
- Clone this repository.
- Inside the repositories root directory run `./set-env.sh dev`.
- If you want to serve the frontend on an address other than `http://localhost:4200`, adjust the `ALLOWEDORIGINS` environment in `docker-compose.yml`.
...
## Running
- Run `docker-compose up`. Append `-d` to run in detached mode for production.
- Run `docker-compose down` stop and remove the containers.
- Run `docker-compose pull` to update the images.
...
## Troubleshooting
...
......@@ -125,13 +125,13 @@ function generateSecrets {
# The DEV variables
POSTGRES_SECRET="fragjetzt"
RABBITMQ_SECRET="guest"
JWT_SECRET=$(openssl rand --hex 32)
else
# The PROD variables
POSTGRES_SECRET=$(openssl rand --hex 32)
RABBITMQ_SECRET=$(openssl rand --hex 32)
JWT_SECRET=$(openssl rand --hex 32)
fi
JWT_SECRET=$(openssl rand --hex 32)
}
# Write out the environment files
......@@ -170,7 +170,7 @@ function createEnvironments {
# Run the substitution
for FILE in environments/*.env; do
for ENV_STRING in ${ENV_STRINGS}; do
sed -i "s/^${ENV_STRING%%=*}=\$/${ENV_STRING%%=*}=${ENV_STRING#*=}/" "${FILE}"
sed -i "s/^${ENV_STRING%%=*}=\$/${ENV_STRING}/" "${FILE}"
done
done
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment