A dockerized chat application powered by the AT Protocol with nginx for TLS termination.
- Environment-based configuration: All hardcoded URLs are now configurable via environment variables
- Docker support: Complete containerization with nginx reverse proxy
- TLS termination: nginx handles SSL/TLS, Node.js serves HTTP
- Local development ready: Works with localhost and custom domains
- OAuth optional: Can run without OAuth for local testing
- AT Protocol integration: Real-time messaging via Bluesky's AT Protocol
-
Generate SSL certificates for local development:
./generate-certs.sh
-
Start the application:
docker compose up
-
Access the application:
- HTTPS: https://localhost:8080
- HTTP (redirect to HTTPS): http://localhost:8081
| Variable | Default | Description |
|---|---|---|
DOMAIN |
localhost:8080 |
The domain name and port for the application |
PROTOCOL |
https |
Protocol (http/https) |
WS_PROTOCOL |
wss |
WebSocket protocol (ws/wss) |
PORT |
3000 |
Internal Node.js server port |
ENABLE_OAUTH |
false |
Enable/disable OAuth authentication |
For production deployment, update the environment variables in docker-compose.yml:
environment:
- DOMAIN=yourdomain.com
- PROTOCOL=https
- WS_PROTOCOL=wss
- PORT=3000
- NODE_ENV=production
- ENABLE_OAUTH=trueAnd replace the self-signed certificates in the ssl/ directory with proper certificates.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Client │───▶│ nginx │───▶│ Node.js App │
│ (Browser) │ │ (TLS Proxy) │ │ (Port 3000) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐
│ SSL Certs │
│ (ssl/ dir) │
└─────────────────┘
The application is configured to run without OAuth in local development mode by default. This allows you to test the UI and basic functionality without setting up Bluesky OAuth credentials.
To enable OAuth for production or testing:
- Set
ENABLE_OAUTH=true - Use a non-localhost domain
- Configure proper SSL certificates
- Ensure the domain is accessible from the internet for OAuth callbacks
Dockerfile- Node.js application containerdocker-compose.yml- Multi-container setup with nginxnginx.conf.template- nginx configuration templategenerate-certs.sh- SSL certificate generation script.dockerignore- Docker build exclusions
The application provides a health endpoint at /health that returns the current status and configuration.
If you see SSL certificate errors, regenerate the certificates:
rm -rf ssl/
./generate-certs.shIf ports 8080 or 8081 are in use, modify the ports in docker-compose.yml:
ports:
- "9080:443" # Change 8080 to 9080
- "9081:80" # Change 8081 to 9081If you see Node.js module errors, rebuild the containers:
docker compose down
docker compose build --no-cache
docker compose up