分类
标签
Alist amd Artalk artalk Astro centos chajian chatgpt cloud torrent clover CommentsByQQ Docker edid fly.io fuwari Github Gotosocial hackintool Hexo hexo lede linux Linux macos Mariadb mastodon memos Memos office opencore openwrt Pleroma QQ机器人 samsung SForum torrent Twikoo typecho V2RAY VPS webhook windows 下载 主控 免驱 博客 厂商 命令 固态 字体 开卡 教程 显卡 梯子 注册 生活 硬盘 硬盘盒 磁力 科学上网 笔记本 自动化 虚拟信用卡 观影 评论 豆瓣 软路由 部署 阿里 阿里悟空 霞鹜文楷 黑苹果
250 字
1 分钟
Docker部署Activity-Relay服务
- 经过测试国内部署会有无法通讯的问题.
测试环境
centos7.9
准备工作
- git
- openssl
- nginx
- docker
- docker-compose
从仓库Pull a repository
git clone https://github.com/yukimochi/Activity-Relay.git -b v2.0.0
复制编辑config.yml
进入Activity-Relay
目录
cd Activity-Relay
cp config.yml.example config.yml
修改相关配置
vim config.yml
生成actor RSA 证书 ./actor.pem
ubuntu使用
openssl genrsa -traditional | tee actor.pem
centos使用
openssl genrsa -out actor.pem 1024 | tee actor.pem
赋予权限600
chmod 600 actor.pem
构建镜像与运行服务
docker-compose build
docker-compose up -d
查看容器运行状态
docker-compose ps
停止服务
docker-compose down
相关参考
docker-compose配置
version: "2.3"
services:
redis:
restart: always
image: redis:alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
volumes:
- "./redisdata:/data"
worker:
container_name: worker
build: .
image: yukimochi/activity-relay
working_dir: /var/lib/relay
restart: always
init: true
command: relay worker
volumes:
- "./actor.pem:/var/lib/relay/actor.pem"
- "./config.yml:/var/lib/relay/config.yml"
depends_on:
- redis
server:
container_name: relay
build: .
image: yukimochi/activity-relay
working_dir: /var/lib/relay
restart: always
init: true
ports:
- "8080:8080"
command: relay server
volumes:
- "./actor.pem:/var/lib/relay/actor.pem"
- "./config.yml:/var/lib/relay/config.yml"
depends_on:
- redis
Nginx设置
upstream relay {
server 127.0.0.1:8080;
}
server {
server_name relay.example.com;
location / {
root /var/lib/relay;
try_files $uri $uri/index.html =404;
}
location /inbox {
rewrite ^/inbox(.*) /$1 break;
proxy_pass http://relay/;
proxy_pass_request_headers on;
proxy_set_header Host $http_host;
}
location /actor {
rewrite ^/inbox(.*) /$1 break;
proxy_pass http://relay/;
proxy_pass_request_headers on;
proxy_set_header Host $http_host;
}
}
Docker部署Activity-Relay服务
https://blog.ittst.com/posts/docker-deploy-activity-relay-service/