|
@@ -1,3 +1,13 @@
|
|
|
|
|
+<!-- --------------------------------------------------------------------------- -->
|
|
|
|
|
+
|
|
|
|
|
+<!-- Folder: Docs -->
|
|
|
|
|
+
|
|
|
|
|
+<!-- File: runbook.md -->
|
|
|
|
|
+
|
|
|
|
|
+<!-- Relative Path: Docs/runbook.md -->
|
|
|
|
|
+
|
|
|
|
|
+<!-- --------------------------------------------------------------------------- -->
|
|
|
|
|
+
|
|
|
# Runbook: Local Development vs Server Deployment
|
|
# Runbook: Local Development vs Server Deployment
|
|
|
|
|
|
|
|
This runbook describes how to run the project locally (developer machine) and on the internal server.
|
|
This runbook describes how to run the project locally (developer machine) and on the internal server.
|
|
@@ -23,6 +33,12 @@ The goal is a **clean separation** between:
|
|
|
- Local override
|
|
- Local override
|
|
|
- Mounts local fixtures: `./.local_nas:/mnt/niederlassungen:ro`
|
|
- Mounts local fixtures: `./.local_nas:/mnt/niederlassungen:ro`
|
|
|
|
|
|
|
|
|
|
+- `docker-compose.server-tools.yml` (optional)
|
|
|
|
|
+
|
|
|
|
|
+ - Server-only tooling/override compose file.
|
|
|
|
|
+ - Intended for additional server services or operational tooling.
|
|
|
|
|
+ - Usually enabled on the server via `COMPOSE_FILE` or `-f` flags.
|
|
|
|
|
+
|
|
|
### 1.2 Env files
|
|
### 1.2 Env files
|
|
|
|
|
|
|
|
- Committed templates:
|
|
- Committed templates:
|
|
@@ -38,7 +54,7 @@ The goal is a **clean separation** between:
|
|
|
|
|
|
|
|
- `.env.server`
|
|
- `.env.server`
|
|
|
|
|
|
|
|
-The compose file uses:
|
|
|
|
|
|
|
+The compose setup uses:
|
|
|
|
|
|
|
|
- `ENV_FILE` to select which env file is loaded into the `app` container.
|
|
- `ENV_FILE` to select which env file is loaded into the `app` container.
|
|
|
|
|
|
|
@@ -260,6 +276,12 @@ Use the base compose file only (no local override):
|
|
|
ENV_FILE=.env.server docker compose -f docker-compose.yml up -d --build
|
|
ENV_FILE=.env.server docker compose -f docker-compose.yml up -d --build
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
|
+> If you configured a server-local `.env` file (see 3.4.1 / 3.4.2), you can use the short form:
|
|
|
|
|
+>
|
|
|
|
|
+> ```bash
|
|
|
|
|
+> docker compose up -d --build
|
|
|
|
|
+> ```
|
|
|
|
|
+
|
|
|
### 3.4.1 Optional: Persist ENV_FILE selection via `.env`
|
|
### 3.4.1 Optional: Persist ENV_FILE selection via `.env`
|
|
|
|
|
|
|
|
If you want a simpler startup command (and to avoid forgetting `ENV_FILE=...`), you can create a small `.env` file **on the server only** that defines which env file Compose should use.
|
|
If you want a simpler startup command (and to avoid forgetting `ENV_FILE=...`), you can create a small `.env` file **on the server only** that defines which env file Compose should use.
|
|
@@ -282,6 +304,34 @@ Notes:
|
|
|
- `.env.server` still contains secrets and must not be committed.
|
|
- `.env.server` still contains secrets and must not be committed.
|
|
|
- Always run `docker compose` from the project root so Compose picks up the correct `.env` file.
|
|
- Always run `docker compose` from the project root so Compose picks up the correct `.env` file.
|
|
|
|
|
|
|
|
|
|
+### 3.4.2 Optional: Persist ENV_FILE + COMPOSE_FILE selection via `.env`
|
|
|
|
|
+
|
|
|
|
|
+If your server setup uses multiple compose files (e.g. base + server tooling), you can also persist the compose file selection in the same **server-local** `.env` file.
|
|
|
|
|
+
|
|
|
|
|
+Example `./.env` (server only, do not commit):
|
|
|
|
|
+
|
|
|
|
|
+```env
|
|
|
|
|
+ENV_FILE=.env.server
|
|
|
|
|
+COMPOSE_FILE=docker-compose.yml:docker-compose.server-tools.yml
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+Notes:
|
|
|
|
|
+
|
|
|
|
|
+- `COMPOSE_FILE` supports multiple files separated by `:` (common on Linux servers).
|
|
|
|
|
+- Keep `.env` and `.env.server` server-local (do not commit).
|
|
|
|
|
+
|
|
|
|
|
+After that, you can start/update the stack with:
|
|
|
|
|
+
|
|
|
|
|
+```bash
|
|
|
|
|
+docker compose up -d --build
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+Optional: verify which configuration Compose is actually using:
|
|
|
|
|
+
|
|
|
|
|
+```bash
|
|
|
|
|
+docker compose config
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
### 3.5 Verify
|
|
### 3.5 Verify
|
|
|
|
|
|
|
|
On the server:
|
|
On the server:
|
|
@@ -322,4 +372,4 @@ docker compose -f docker-compose.yml logs --tail=200 app
|
|
|
|
|
|
|
|
For real users, the application should be served over HTTPS (reverse proxy / TLS termination).
|
|
For real users, the application should be served over HTTPS (reverse proxy / TLS termination).
|
|
|
|
|
|
|
|
-If HTTPS is enabled, keep the default secure-cookie behavior.
|
|
|
|
|
|
|
+If HTTPS is enabl
|