feat: add small VPS deployment

This commit is contained in:
Jesse_Chen
2026-07-16 09:31:48 +08:00
parent bca33ada66
commit 174d65008a
3 changed files with 68 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
{$SITE_ADDRESS:http://103.117.123.53} {
encode zstd gzip
reverse_proxy web:3000
}
+10
View File
@@ -50,3 +50,13 @@ LLM_MODEL=...
1. Add the generated `web` domain to Supabase Auth **Site URL** and **Redirect URLs**.
2. Open `/login`, sign in with an address listed in `ADMIN_EMAILS`, then verify `/admin/codes`.
3. Keep `api` private; verify its `/api/health` from Railway logs or the `web` service.
## Small VPS deployment
For a single low-traffic server, keep Supabase managed and run only the Web and API services:
```bash
docker compose --env-file .env.production -f deploy/docker-compose.server.yml up -d --build
```
Set `SITE_ADDRESS=http://SERVER_IP` for initial HTTP testing. Replace it with the production domain after DNS resolves; Caddy will then provision HTTPS automatically.
+54
View File
@@ -0,0 +1,54 @@
services:
api:
build:
context: ..
dockerfile: deploy/railway-api.Dockerfile
restart: unless-stopped
env_file: ../.env.production
environment:
PORT: 5200
expose:
- "5200"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:5200/api/health', timeout=3)"]
interval: 30s
timeout: 5s
retries: 5
web:
build:
context: ..
dockerfile: deploy/railway-web.Dockerfile
args:
NEXT_PUBLIC_SUPABASE_URL: ${NEXT_PUBLIC_SUPABASE_URL}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${NEXT_PUBLIC_SUPABASE_ANON_KEY}
restart: unless-stopped
env_file: ../.env.production
environment:
PORT: 3000
JYOTISH_API_BASE: http://api:5200
expose:
- "3000"
depends_on:
api:
condition: service_healthy
caddy:
image: caddy:2-alpine
restart: unless-stopped
environment:
SITE_ADDRESS: ${SITE_ADDRESS:-http://103.117.123.53}
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
depends_on:
- web
volumes:
caddy_data:
caddy_config: