AowerDmax / Simple-Interview-Audio-Processing

135 stars 18 forks source link

8080端口显示Interview Dialog #10

Closed as154 closed 1 month ago

as154 commented 1 month ago

我在客户端访问8080端口如图所示 {91F39D5E-DB1E-40dd-98EB-8B705F4FB53D} 然后我服务端使用curl看了看: `# curl 127.0.0.1:8080 <!DOCTYPE html>

Interview Dialog

Interview Dialog

` 然后我进入了容器内部: `# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES da65b459e195 ghcr.io/aowerdmax/websocket-redis/websocket_redis:latest "/app/main" 2 days ago Up 8 minutes 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp simple-interview-audio-processing-app-1 d020744f2282 registry.cn-hangzhou.aliyuncs.com/funasr_repo/funasr:funasr-runtime-sdk-online-cpu-0.1.10 "/bin/bash" 2 days ago Up 8 minutes 0.0.0.0:10096->10095/tcp, :::10096->10095/tcp funasr_interview 62841e251115 getmeili/meilisearch:latest "tini -- /bin/sh -c …" 2 days ago Up 8 minutes 0.0.0.0:7700->7700/tcp, :::7700->7700/tcp simple-interview-audio-processing-meilisearch-1 912045b9983c registry.cn-hangzhou.aliyuncs.com/funasr_repo/funasr:funasr-runtime-sdk-online-cpu-0.1.10 "/bin/bash" 2 days ago Up 8 minutes 0.0.0.0:10097->10095/tcp, :::10097->10095/tcp funasr_rookie e6149d1549e6 redis:latest "docker-entrypoint.s…" 2 days ago Up 8 minutes 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp simple-interview-audio-processing-redis-1 root@ssk:/home/ssk/Simple-Interview-Audio-Processing# docker exec -it d020744f2282 /bin/bash root@d020744f2282:/workspace# curl 127.0.0.1 curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused root@d020744f2282:/workspace# curl 127.0.0.1:8080 curl: (7) Failed to connect to 127.0.0.1 port 8080: Connection refused ` 这应该怎么解决呢?
as154 commented 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#
as154 commented 1 month ago

发现问题了。 服务端也需要更改.env文件