Improved deployment, logs and update docs.

This commit is contained in:
2025-05-31 14:23:55 +02:00
parent 1523a45008
commit 89eef326a7
6 changed files with 42 additions and 6 deletions
+26
View File
@@ -1,6 +1,7 @@
<!-- omit in toc -->
# SomniaRooms - How to deploy.
- [Environment Vars](#environment-vars)
- [Docker compose examples.](#docker-compose-examples)
- [Deploy back-end and front-end on different servers (different ip address).](#deploy-back-end-and-front-end-on-different-servers-different-ip-address)
- [Deploy on the same server.](#deploy-on-the-same-server)
@@ -14,12 +15,37 @@ Production images for Docker Containers are available from Gitea Registry.
Documentation on how to deploy them as containers can be found at [Readme](../README.md).
## Environment Vars
Hare is a list of some "important" or useful environment vars to consider when deploying SomniaRooms
| Var | Required | Default Value | Description |
| :------------------------: | :----------------: | :--------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `SERVER_NAME` | :heavy_check_mark: | `-` | Your server hostname to be used by Caddy. Should include "http://". |
| `DATABASE_URL` | :heavy_check_mark: | `-` | Connection string for database. See: https://symfony.com/doc/current/doctrine.html#configuring-the-database |
| `APP_SECRET` | :heavy_check_mark: | `ChangeMySecret` | Symfony App secret. You really should change this. . You can use `openssl rand -base64 36` to generate random strings |
| `TRUSTED_PROXIES` | :heavy_check_mark: | `-` | Allowed proxies address. The proxy IP should be used. Must be set when used behind some proxy/reverse-proxy: traefik (see example below), nginx, .... |
| `TRUSTED_HOSTS` | :heavy_check_mark: | `-` | ¿? You may have to set this to your `SERVER_NAME`, but I don't remember how it worked. |
| `APP_ENV` | :x: | `dev` | Set current app environment. Set to `prod` from production use. |
| `FRANKENPHP_CONFIG` | :x: | `-` | Add extra config for FrankenPHP. See: https://frankenphp.dev/docs/config/ |
| `FRANKENPHP_WORKER_CONFIG` | :x: | `-` | Add extra config for FrankenPHP Workers. See: https://frankenphp.dev/docs/config/ |
| `FRANKENPHP_USEWORKER` | :x: | `-` | Enable/disable FrankenPHP Workers. Valid values: `none` (disabled) /`worker` (enabled) |
| `MERCURE_...` | :x: | `-` | Just copy default values from `compose.yaml`. SomniaRooms don't use Mercure right now and may get removed. |
| `SOMNIA_LOGSDIR` | :x: | `/somnia_logs` | Path for App logs. It's recomended to save them on a volume or host-path (even in production?) just in case, as not all errors may be print to the console. |
For running SomniaRooms behind a proxy, see: https://symfony.com/doc/current/deployment/proxies.html
## Docker compose examples.
Here are some deploy examples using docker compose:
SomniaRooms back-end and front-end can run on the same machine, but some config is needed to work.
> [!WARNING]
> **NOTE (31/05/2025)**: Some examples may be out-of-date. Use only as reference! Check ["dev" `compose.yaml`](../compose.yaml) and [Readme](../README.md) and apply relevant diffs.
### Deploy back-end and front-end on different servers (different ip address).
If your servers have different IP addresses everything is a little bit easier. You can set-up subdomains for each one.