Open matthuo333 opened 1 year ago
请问Nginx端口改成多少了的呢?我修改一下,然后Build试试。 如果没有特殊需求,也可以用我 Build 的 Docker Image 试试。
docker pull ghcr.io/erbanku/speechgpt:0.4.0
改成了 48080
改成了 48080
我这边没有遇到问题,修改 Nginx 端口后也 Build 成功了,可能是系统环境配置的问题。
修改后 Build 的 Image,可以拿去用:Package speechgpt-a
docker pull ghcr.io/erbanku/speechgpt-a:latest
多谢了! 先暂时用官方提供image, 不过运行后出现 “Error with builtin speech recognition”, 然后放行浏览器对于mirophone的block , 刷新后又限制。
如果访问的端口不是ssl 或tls 是不能允许开启mirophone
看来又必须重新build了
我重新安装docker后,貌似还不是不行。你的Dockerfile 能分享下?
我重新安装docker后,貌似还不是不行。你的Dockerfile 能分享下?
Dockerfile
FROM node:alpine as builder
ARG VITE_OPENAI_API_KEY=REPLACE_WITH_YOUR_OWN
ARG VITE_OPENAI_HOST=REPLACE_WITH_YOUR_OWN
ARG VITE_AWS_REGION=REPLACE_WITH_YOUR_OWN
ARG VITE_AWS_ACCESS_KEY_ID=REPLACE_WITH_YOUR_OWN
ARG VITE_AWS_ACCESS_KEY=REPLACE_WITH_YOUR_OWN
ARG VITE_AZURE_REGION=REPLACE_WITH_YOUR_OWN
ARG VITE_AZURE_KEY=REPLACE_WITH_YOUR_OWN
ENV VITE_OPENAI_API_KEY=$VITE_OPENAI_API_KEY \
VITE_OPENAI_HOST=$VITE_OPENAI_HOST \
VITE_AWS_REGION=$VITE_AWS_REGION \
VITE_AWS_ACCESS_KEY_ID=$VITE_AWS_ACCESS_KEY_ID \
VITE_AWS_ACCESS_KEY=$VITE_AWS_ACCESS_KEY \
VITE_AZURE_REGION=$VITE_AZURE_REGION \
VITE_AZURE_KEY=$VITE_AZURE_KEY
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install
COPY . .
RUN yarn build
FROM nginx:alpine
COPY nginx.conf /etc/nginx/nginx.conf
WORKDIR /usr/share/nginx/html
COPY --from=builder /app/dist .
ENTRYPOINT ["nginx", "-g", "daemon off;"]
建议用干净的 linux 系统(VPS之类的)来 Build,这样你会很少遇到奇怪的问题。
换了个Centos 系统,没问题了。 但是,在需要对容器加入ssl时候遇到问题。 下面是修改后的nginx配置,同时也在Dockerfile中加入了导入证书的COPY
但最后需要先运行 xxx.com:[80mapping port], 然后再运行 xxx.com:[443mapping port], 这样才OK,请大神看看什么原因呢?
worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; gzip on; server { listen 443 ssl; server_name xxx.com;
ssl_certificate /etc/ssl/certs/xxx.cer;
ssl_certificate_key /etc/ssl/private/xxxx.key;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}
server {
listen 80;
server_name xxx.com;
return 301 https://$host$request_uri;
}
}
Describe the bug
改了Dockfile 中的nginx监听端口,然后执行docker build, 出现如下后,检查结果没有image.
docker build . -t speechgpt --network host [+] Building 1213.7s (13/15)
=> [internal] load .dockerignore 0.0s => => transferring context: 206B 0.0s => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 932B 0.0s => [internal] load metadata for docker.io/library/nginx:alpine 1.7s => [internal] load metadata for docker.io/library/node:alpine 1.7s => [builder 1/6] FROM docker.io/library/node:alpine@sha256:53741c7511b1836b5eb7e788a7b399c058b0b549f205d2c6af831ec1a9a81c31 0.0s => [internal] load build context 0.0s => => transferring context: 9.23kB 0.0s => [stage-1 1/4] FROM docker.io/library/nginx:alpine@sha256:dd2a9179765849767b10e2adde7e10c4ad6b7e4d4846e6b77ec93f080cd2db27 0.0s => CACHED [builder 2/6] WORKDIR /app 0.0s => CACHED [builder 3/6] COPY package.json yarn.lock ./ 0.0s => CACHED [builder 4/6] RUN yarn install 0.0s => CACHED [builder 5/6] COPY . . 0.0s => CACHED [stage-1 2/4] COPY nginx.conf /etc/nginx/nginx.conf 0.0s => CACHED [stage-1 3/4] WORKDIR /usr/share/nginx/html 0.0s => [builder 6/6] RUN yarn build 1364.3s => => # yarn run v1.22.19
=> => # $ tsc && vite build
Steps to reproduce
步骤同上
Screenshots or additional context
No response