Closed as154 closed 1 month ago
我重新拉取了创建了容器,这个时候显示的不一样了:
root@ssk:/home/ssk/Simple-Interview-Audio-Processing# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bd3ed35588b0 ghcr.io/aowerdmax/websocket-redis/websocket_redis:latest "/app/main" 5 minutes ago Up 5 minutes 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp simple-interview-audio-processing-app-1
53ffcd394c22 registry.cn-hangzhou.aliyuncs.com/funasr_repo/funasr:funasr-runtime-sdk-online-cpu-0.1.10 "/bin/bash" 5 minutes ago Up 5 minutes 0.0.0.0:10096->10095/tcp, :::10096->10095/tcp funasr_interview
8bd07873ac88 registry.cn-hangzhou.aliyuncs.com/funasr_repo/funasr:funasr-runtime-sdk-online-cpu-0.1.10 "/bin/bash" 5 minutes ago Up 5 minutes 0.0.0.0:10097->10095/tcp, :::10097->10095/tcp funasr_rookie
19ff221452fb redis:latest "docker-entrypoint.s…" 5 minutes ago Up 5 minutes 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp simple-interview-audio-processing-redis-1
534943c09b16 getmeili/meilisearch:latest "tini -- /bin/sh -c …" 5 minutes ago Up 5 minutes 0.0.0.0:7700->7700/tcp, :::7700->7700/tcp simple-interview-audio-processing-meilisearch-1
root@ssk:/home/ssk/Simple-Interview-Audio-Processing# docker exec -it bd3ed35588b0 /bin/sh
/app # ls
Dockerfile README.md data env.template go.sum main static
KnowledgeDatabase config docker-compose.yml go.mod index.html main.go websocket
/app # docker
/bin/sh: docker: not found
/app # netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.11:41105 0.0.0.0:* LISTEN
tcp 0 0 :::8080 :::* LISTEN
udp 0 0 127.0.0.11:55779 0.0.0.0:*
/app # ./main
server start! http://0.0.0.0:8080
2024/09/10 01:44:16 listen tcp 0.0.0.0:8080: bind: address already in use
/app #
程序已经在监听8080端口了,但是我在客户端使用curl访问时依旧无法正常显示:
root@ssk:/home/ssk/Simple-Interview-Audio-Processing# curl 127.0.0.1:8080
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Interview Dialog</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/nextui/1.0.0-beta.10/nextui.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.1.0/github-markdown-light.min.css">
<link rel="stylesheet" href="/static/css/styles.css">
</head>
<body>
<div class="chat-container">
<h2>Interview Dialog</h2>
<div id="chatContent"></div>
</div>
<script src="/ws-config.js"></script>
<script src="/static/js/scripts.js"></script>
</body>
</html>root@ssk:/home/ssk/Simple-Interview-Audio-Processing#
发现问题了。 服务端也需要更改.env文件
我在客户端访问8080端口如图所示 然后我服务端使用curl看了看: `# curl 127.0.0.1:8080 <!DOCTYPE html>
Interview Dialog