briefing是一个开源的、安全的直接视频群聊平台。
本次实践为个人测试环境,操作系统版本为centos7.6。
hostname | IP地址 | 操作系统版本 | Docker版本 |
---|---|---|---|
dokcer | 192.168.3.166 | centos 7.6 | 2 20.10.17 |
1.本次实践部署环境为个人测试环境,生产环境请谨慎;
2.在Docker环境下部署briefing视频聊天系统。
检查Docker服务是否正常运行,确保Docker正常运行。
[root@jeven ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2023-12-21 18:58:04 CST; 3 days ago
Docs: https://docs.docker.com
Main PID: 11425 (dockerd)
Tasks: 47
Memory: 387.3M
CGroup: /system.slice/docker.service
├─11425 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
检查Docker版本
[root@jeven ~]# docker -v
Docker version 20.10.17, build 100c701
检查Docker compose版本,确保2.0以上版本。
[root@jeven ~]# docker compose version
Docker Compose version v2.6.0
从docker hub拉取briefing镜像
[root@jeven nullboard]# docker pull holtwick/briefing
Using default tag: latest
latest: Pulling from holtwick/briefing
661ff4d9561e: Pull complete
89059ca18a98: Pull complete
9bb776f8ddb0: Pull complete
ef0b6390b7f1: Pull complete
e4cdfee850fc: Pull complete
4f4fb700ef54: Pull complete
Digest: sha256:bd6afac29ce56fdcb689e03204dd00ebcfdd2690a55a817fdc00ef0799a4c99b
Status: Downloaded newer image for holtwick/briefing:latest
docker.io/holtwick/briefing:latest
使用docker-cli快速部署briefing容器
docker run -d \ \
--name briefing \
-v /datar/briefing/data:/app/data \
-p 6802:8080 \
--restart always \
holtwick/briefing
创建挂载目录
[root@jeven ~]# mkdir -p /data/briefing
[root@jeven ~]# cd /data/briefing/
本次实践部署使用docker compose方式,编辑docker-compose.yaml文件。
version: '3'
services:
briefing:
image: holtwick/briefing
restart: always
volumes:
- /datar/briefing/data:/app/data
ports:
- 6802:8080
# networks:
# default:
# external:
# name: proxy
使用docker-compose.yaml文件创建briefing容器
[root@jeven briefing]# docker compose up -d
[+] Running 2/2
? Network briefing_default Created 0.0s
? Container briefing-briefing-1 Started 1.2s
检查briefing容器状态,确保briefing容器正常启动。
[root@jeven briefing]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9c08e1730708 holtwick/briefing "docker-entrypoint.s…" 39 seconds ago Up 37 seconds 3478/tcp, 0.0.0.0:6802->8080/tcp, :::6802->8080/tcp briefing-briefing-1
检查briefing容器运行日志,确保briefing服务正常启动。
[root@jeven briefing]# docker logs briefing-briefing-1
Zerva: Vite serving from /app/www
Zerva: *********************************************************
Zerva: Open page at http://localhost:8080
Zerva: *********************************************************
由于是测试环境,本次反向代理直接部署在本地Docker宿主机同一台服务器上,直接使用yum快速安装nginx。
yum -y install nginx
启动nginx服务
[root@jeven briefing]# systemctl enable --now nginx
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
检查nginx服务状态
[root@jeven briefing]# systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2023-12-26 16:40:11 CST; 24s ago
Process: 81723 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
Process: 81720 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 81718 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Main PID: 81725 (nginx)
Tasks: 3
Memory: 2.1M
CGroup: /system.slice/nginx.service
├─81725 nginx: master process /usr/sbin/nginx
├─81726 nginx: worker process
└─81727 nginx: worker process
Dec 26 16:40:10 jeven systemd[1]: Starting The nginx HTTP and reverse proxy server...
Dec 26 16:40:11 jeven nginx[81720]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Dec 26 16:40:11 jeven nginx[81720]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Dec 26 16:40:11 jeven systemd[1]: Started The nginx HTTP and reverse proxy server.
openssl genrsa -out nginx.key 2048
openssl req -new -key nginx.key -out nginx.csr
openssl x509 -req -in nginx.csr -signkey nginx.key -out nginx.pem
[root@jeven briefing]# ls
docker-compose.yaml nginx.csr nginx.key nginx.pem
修改nginx配置文件/etc/nginx/nginx.conf
mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
vim /etc/nginx/nginx.conf
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
# upstream web {
# server 192.168.3.166;
# }
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
proxy_pass http://192.168.3.166:6802;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
server {
listen 443 ssl;
server_name localhost;
ssl_certificate /data/briefing/nginx.pem;
ssl_certificate_key /data/briefing/nginx.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root html;
index index.html index.htm;
proxy_pass http://192.168.3.166:6802;
}
}
}
重启nginx服务
systemctl restart nginx
访问地址:https://192.168.3.166/,将IP替换为自己服务器IP地址,进入到briefing首页。如果无法访问,则检查服务器防火墙是否设置,云服务器的安全组端口是否放行等。
将链接地址发送给视频聊天的人员就可以了,这里由于是台式机没有摄像头显示。