78 lines
4.8 KiB
Markdown
78 lines
4.8 KiB
Markdown
# Proxmox Docker hosting
|
|
|
|
Use a Linux guest with Docker Engine and the Docker Compose plugin installed. Copy this repository to the guest, or clone it after committing and pushing your changes. From the repository directory:
|
|
|
|
```sh
|
|
cp .env.example .env
|
|
# Edit .env: set BIND_ADDRESS to the portfolio guest's LAN IP.
|
|
docker compose up -d --build
|
|
docker compose ps
|
|
# Replace the example IP with the portfolio guest's LAN IP:
|
|
curl -f http://192.168.1.50:8080/healthz
|
|
```
|
|
|
|
Docker validates content, runs tests and builds inside a Node build stage. Only static assets enter the Nginx runtime image. No Node installation, database or persistent volume is required on the guest. Configure the guest and Docker to start on boot; the service uses `restart: unless-stopped`.
|
|
|
|
## Network access
|
|
|
|
The default binding is `127.0.0.1:8080`, accessible only on the Docker guest. A reverse proxy running directly on that guest can forward to it.
|
|
|
|
For access from your laptop or a reverse proxy on another machine, edit `.env` to use the guest's actual LAN IP:
|
|
|
|
```dotenv
|
|
BIND_ADDRESS=192.168.1.50
|
|
PORTFOLIO_PORT=8080
|
|
```
|
|
|
|
Run `docker compose up -d` again, then open `http://192.168.1.50:8080` using your actual IP. Restrict port 8080 at the network/Proxmox firewall to the intended LAN or reverse proxy. Change `PORTFOLIO_PORT` if the port is already occupied.
|
|
|
|
## Separate Nginx Proxy Manager box
|
|
|
|
Your topology is: Internet → Nginx Proxy Manager (HTTPS) → portfolio guest LAN IP:8080 (HTTP). The portfolio container needs no certificate or domain configuration.
|
|
|
|
In Nginx Proxy Manager, add a **Proxy Host** with these settings:
|
|
|
|
| Setting | Value |
|
|
| --- | --- |
|
|
| Domain Names | Your portfolio domain, such as `portfolio.example.com` |
|
|
| Scheme | `http` |
|
|
| Forward Hostname / IP | The portfolio guest's LAN IP, such as `192.168.1.50` |
|
|
| Forward Port | `8080`, or your chosen `PORTFOLIO_PORT` |
|
|
| Access List | Publicly Accessible, for a public portfolio |
|
|
| Cache Assets | Off, so content edits revalidate immediately |
|
|
| Websockets Support | Off; this static site does not use WebSockets |
|
|
| SSL Certificate | Select an existing matching certificate or request one |
|
|
| Force SSL | On after the certificate is configured |
|
|
|
|
Leave Advanced configuration and Custom Locations empty. Serve the portfolio at the domain root. Hash routes, project links and both languages work without rewrite rules. Nginx Proxy Manager is designed to act as the gateway and manage SSL; see its [official guide](https://nginxproxymanager.com/guide/).
|
|
|
|
Use the portfolio guest's LAN address as the upstream, not `localhost`, the proxy box's IP or the Docker service name. Separate machines do not share the local Docker bridge network.
|
|
|
|
Point your domain DNS at the public address used by Nginx Proxy Manager. Your router's public ports 80/443 should reach the proxy box. Do not forward public port 8080 to the portfolio guest. At the Proxmox/network firewall, allow inbound TCP 8080 to the portfolio guest from the proxy box's LAN IP and deny other sources. Binding to a LAN IP alone does not impose this source restriction. These firewall/DNS settings must be applied in your infrastructure; this repository does not configure them.
|
|
|
|
From the proxy box, verify `curl -f http://192.168.1.50:8080/healthz` returns `ok` (substitute your IP). Then open the public HTTPS domain and test a project and language switch. If Nginx Proxy Manager returns 502, check the upstream IP, HTTP scheme, port, container status and firewall access from the proxy box.
|
|
|
|
## Updates
|
|
|
|
Edit the JSON source files locally, then sync the changed files to the guest, including removing deleted project files. With Git, commit/push locally and pull on the guest. Apply updates with:
|
|
|
|
```sh
|
|
docker compose up -d --build
|
|
```
|
|
|
|
Restarting alone does not import edited content; the files are baked into the image. Keep and back up the source checkout. Do not edit inside the container. To refresh base images, run `docker compose build --pull`, then `docker compose up -d`.
|
|
|
|
## Operations and exposure
|
|
|
|
```sh
|
|
docker compose logs --tail=100 portfolio
|
|
docker compose ps
|
|
docker compose down
|
|
```
|
|
|
|
The container runs as the Nginx user with a read-only filesystem, dropped Linux capabilities and temporary memory-backed storage. The server exposes only the public website assets and `/healthz`; there is no admin or editing endpoint. Everything in the built content remains public. The development server is not used for hosting.
|
|
|
|
The health check expects `/healthz` to return `ok`. The restart policy handles process exits; an unhealthy status alone does not restart the container. Compose settings follow the [Docker service reference](https://docs.docker.com/reference/compose-file/services/).
|
|
|
|
Local content tests, static build and Compose configuration validation passed. The container could not be built or run locally because the Docker engine was unavailable. Nothing has been deployed to Proxmox.
|