docs(gremlin): update web
This commit is contained in:
parent
ebdbe08b04
commit
b6292e7468
1 changed files with 30 additions and 43 deletions
|
|
@ -1,20 +1,24 @@
|
||||||
# web Stack
|
|
||||||
|
|
||||||
description: PHP/Apache web server with Caddy reverse proxy for NetGrimoire
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
title: web Stack
|
||||||
|
description: NetGrimoire web services
|
||||||
|
published: true
|
||||||
|
date: 2026-05-07T21:43:54.394Z
|
||||||
|
tags: docker,swarm,web,netgrimoire
|
||||||
|
editor: markdown
|
||||||
|
dateCreated: 2026-05-07T21:43:54.394Z
|
||||||
|
---
|
||||||
|
|
||||||
|
# web
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
The `web` stack is a Docker Swarm configuration that deploys a PHP/Apache web server, utilizing Caddy as a reverse proxy. It consists of a single service running on `docker4`, connected to the `netgrimoire` network. This setup provides a stable and scalable environment for hosting web applications.
|
The web stack in NetGrimoire provides a centralized platform for serving web content. It consists of a replicated PHP-based web server that handles requests and serves pages from the /var/www/html directory.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
| Service | Image | Port | Role |
|
| Service | Image | Port | Role |
|
||||||
|---------|-------|------|------|
|
|-|-------|------|------|
|
||||||
- **Host:** docker4
|
- **Host:** docker4
|
||||||
- **Network:** netgrimoire
|
- **Network:** netgrimoire
|
||||||
- **Exposed via:** `www.netgrimoire.com`
|
- **Exposed via:** www.netgrimoire.com
|
||||||
- **Homepage group:** homepage
|
- **Homepage group:** homepage
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
@ -22,22 +26,21 @@ The `web` stack is a Docker Swarm configuration that deploys a PHP/Apache web se
|
||||||
## Build & Configuration
|
## Build & Configuration
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
PHP 8.2-apache image, Docker Swarm manager and worker nodes.
|
This stack requires Docker Swarm and Caddy reverse proxy setup.
|
||||||
|
|
||||||
### Volume Setup
|
### Volume Setup
|
||||||
```bash
|
```bash
|
||||||
mkdir -p /DockerVol/web pages
|
mkdir -p /DockerVol/web/pages:/var/www/html
|
||||||
chown web.web:/var/www/html
|
chown web:web /DockerVol/web/pages
|
||||||
```
|
```
|
||||||
|
|
||||||
### Environment Variables
|
### Environment Variables
|
||||||
```bash
|
```bash
|
||||||
# generate: openssl rand -hex 32
|
|
||||||
PUID=1964
|
PUID=1964
|
||||||
PGID=1964
|
PGID=1964
|
||||||
TZ=America/Chicago
|
TZ=America/Chicago
|
||||||
CADDY_URL=www.netgrimoire.com
|
|
||||||
CADDY_DOMAINS="www.netgrimoire.com"
|
# generate: openssl rand -hex 32 for secrets
|
||||||
```
|
```
|
||||||
|
|
||||||
### Deploy
|
### Deploy
|
||||||
|
|
@ -51,7 +54,7 @@ docker stack services web
|
||||||
```
|
```
|
||||||
|
|
||||||
### First Run
|
### First Run
|
||||||
Perform initial setup, including Caddy configuration and PHP application installation.
|
After deployment, ensure that Caddy is configured to reverse proxy the web service.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -59,52 +62,36 @@ Perform initial setup, including Caddy configuration and PHP application install
|
||||||
|
|
||||||
### Accessing web
|
### Accessing web
|
||||||
| Service | URL | Purpose |
|
| Service | URL | Purpose |
|
||||||
|---------|-----|---------|
|
|-|-------|------|
|
||||||
- **web** | http://web:80 | Serve PHP applications using Apache
|
- **web:** http://www.netgrimoire.com:80 |
|
||||||
|
|
||||||
### Primary Use Cases
|
### Primary Use Cases
|
||||||
Access the `www.netgrimoire.com` website to view NetGrimoire's web application.
|
This stack serves as a primary entry point for accessing NetGrimoire's web services.
|
||||||
|
|
||||||
### NetGrimoire Integrations
|
### NetGrimoire Integrations
|
||||||
Connects to Uptime Kuma, Caddy, and Diun services via environment variables and labels.
|
This stack integrates with Diun, Kuma, and Caddy to provide a robust monitoring, backup, and reverse proxy setup.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Operations
|
## Operations
|
||||||
|
|
||||||
### Monitoring
|
### Monitoring
|
||||||
|
<kuma monitors from kuma.* labels>
|
||||||
```bash
|
```bash
|
||||||
docker stack services web
|
docker stack services web
|
||||||
docker service logs -f web
|
docker service logs -f web
|
||||||
```
|
```
|
||||||
|
|
||||||
### Backups
|
### Backups
|
||||||
Critical `DockerVol/web/pages` volume requires regular backup to ensure data integrity. Reconstructible `DockerVol/web/apache` volume can be restored using the Caddy configuration.
|
Critical data stored in /DockerVol/web/pages should be backed up regularly to prevent loss of content.
|
||||||
|
|
||||||
### Restore
|
### Restore
|
||||||
```bash
|
Restore by re-running the deployment script.
|
||||||
cd services/swarm/stack/web
|
|
||||||
./deploy.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Common Failures
|
## Common Failures
|
||||||
1. Service not starting due to failed Caddy startup: Check Caddy logs and adjust configuration as necessary.
|
| Symptom | Cause | Fix |
|
||||||
2. PHP application crashes: Inspect Apache logs, restart the service if necessary, and ensure proper PHP configuration.
|
|-|-------|------|
|
||||||
3. Network issues with Docker Swarm services: Check network connectivity, verify container configurations, and attempt restarting affected containers.
|
- No reverse proxy is established | Caddy not configured correctly | Check and correct caddy configuration |
|
||||||
|
- Web service is not accessible | Docker swarm services not started | Run docker stack services web |
|
||||||
---
|
|
||||||
|
|
||||||
## Changelog
|
|
||||||
|
|
||||||
| Date | Commit | Summary |
|
|
||||||
|------|--------|---------|
|
|
||||||
| 2026-05-07 | 5389c84f | Initial documentation creation |
|
|
||||||
| 2026-05-01 | c3b0c0f5 | Minor configuration updates and bug fixes |
|
|
||||||
| 2026-02-24 | bffd459a | Caddy reverse proxy integration improvements |
|
|
||||||
| 2026-02-12 | 0d192da2 | PHP/ Apache stack initial setup with environment variables |
|
|
||||||
| 2026-01-22 | 76e190d2 | Docker Swarm manager and worker node compatibility updates |
|
|
||||||
|
|
||||||
<Generated by Gremlin on 2026-05-07T21:43:51.732Z>
|
|
||||||
<Source: swarm/web.yaml>
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue