Add Docker Compose deployment and HTTPS proxy configuration
This commit is contained in:
1 parent
9e9ab03c2b
commit
96596110ec
5 files changed
+60
No files matched your search
@@ -3,3 +3,5 @@ web/node_modules
|
||||
web/dist
|
||||
CONTEXT.md
|
||||
docs
|
||||
.dev-data
|
||||
deploy/data
|
||||
@@ -8,3 +8,4 @@ web/dist/
|
||||
|
||||
# 本地开发数据
|
||||
.dev-data/
|
||||
deploy/data/
|
||||
@@ -4,6 +4,20 @@
|
||||
|
||||
## 部署
|
||||
|
||||
本机部署沿用 `/srv/AlphaPulse/deploy` 的目录约定,端口按 `/docker/main/.env` 的工具类分配为 `RAWMARK_PORT=20080`:
|
||||
|
||||
```sh
|
||||
cd deploy
|
||||
install -d -m 750 -o 65532 -g 65532 data
|
||||
docker compose --env-file /docker/main/.env up -d --build --wait
|
||||
```
|
||||
|
||||
持久化数据位于 `deploy/data/`,与 `.dev-data/` 独立。首次初始化的启动码位于 `deploy/data/setup-code.txt`。
|
||||
宿主机 Nginx 配置为 `deploy/nginx/raw.134333.xyz.conf`,复用现有通配证书及 WebSocket 升级映射;安装到 `/etc/nginx/conf.d/134333.xyz/` 后,先执行 `nginx -t` 再重载。
|
||||
域名 `raw.134333.xyz` 在 DNSPod 设置 CNAME 指向 `cdn.134333.xyz`(与 AlphaPulse 一致),Cloudflare 中对应的源站 A 记录指向部署服务器,访问地址为 `https://raw.134333.xyz`。修改端口时需同步端口登记和 Nginx 上游。
|
||||
|
||||
其他服务器也可直接构建并运行:
|
||||
|
||||
```sh
|
||||
mkdir -p ~/rawmark-data
|
||||
docker build -t rawmark .
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
name: rawmark
|
||||
|
||||
services:
|
||||
rawmark:
|
||||
build:
|
||||
context: ..
|
||||
image: rawmark:local
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "0.0.0.0:${RAWMARK_PORT:-20080}:8080"
|
||||
volumes:
|
||||
- ./data:/data
|
||||
stop_grace_period: 15s
|
||||
@@ -0,0 +1,30 @@
|
||||
# raw.134333.xyz -> RawMark 容器(127.0.0.1:20080)
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name raw.134333.xyz;
|
||||
return 308 https://raw.134333.xyz$request_uri;
|
||||
}
|
||||
server {
|
||||
listen 443 ssl;
|
||||
http2 on;
|
||||
server_name raw.134333.xyz;
|
||||
|
||||
include /etc/nginx/snippets/ssl-134333.xyz.conf;
|
||||
include /etc/nginx/snippets/no-spider.conf;
|
||||
access_log /var/log/nginx/raw.134333.xyz.log;
|
||||
error_log /var/log/nginx/raw.134333.xyz.error.log warn;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:20080;
|
||||
proxy_http_version 1.1;
|
||||
proxy_buffering off;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_read_timeout 1h;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user