Files
internet-engineering-project/DEPLOYMENT.md

1.7 KiB

Demo Deployment

This project can run behind the existing Caddy edge service with this temporary route:

Caddy -> chatroom-nginx -> chatroom-app

The chatroom compose stack joins the existing external Docker network named caddy_proxy. No app ports are published to the host.

Start the Chatroom Stack

From this project directory:

docker compose up -d --build
docker compose ps

Test the FastAPI health endpoint through the Nginx container:

docker compose exec chatroom-nginx wget -qO- http://chatroom-app:8000/health

Temporary Caddy Change

Do this manually in:

D:\Programing\Scripts\Home Lab\Interanet\caddy-deployment\config\caddy\Caddyfile

Add this temporary block:

chat.amiirkhl.ir {
    import {$CADDY_TLS_MODE:custom_tls}
    reverse_proxy chatroom-nginx:80
}

If the current custom certificate does not include chat.amiirkhl.ir, use this instead:

chat.amiirkhl.ir {
    import letsencrypt_tls
    reverse_proxy chatroom-nginx:80
}

Reload Caddy from the Caddy deployment directory:

docker compose exec caddy caddy reload --config /etc/caddy/Caddyfile

Browser Test

Open:

https://chat.amiirkhl.ir

Use two browser tabs, join the same room, and send messages both ways. The frontend builds its WebSocket URL from the current page, so HTTPS should connect with:

wss://chat.amiirkhl.ir/ws/{room}/{user}

Undo After the Demo

  1. Remove the chat.amiirkhl.ir block from the Caddyfile.
  2. Reload Caddy:
docker compose exec caddy caddy reload --config /etc/caddy/Caddyfile
  1. Stop and remove the chatroom stack from this project directory:
docker compose down