-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] window11下 docker官方指导设置编译成功,docker日志无错误,端口8000可访问有404错误,开放3个端口,8080,8000,8899 #4067
Comments
你应该访问 8080 |
启动命令换成这个:yarn start:remote |
yarn start 只监听了 localhost |
reconnecting-websocket-mjs.js:527 WebSocket connection to 'ws://0.0.0.0:8000/service' failed:
| (匿名) | @ | reconnecting-websocket-mjs.js:527
-- | -- | -- | --
启动命令yarn start:remote后,访问8080端口出现ws://0.0.0.0:8000/service错误 [webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled. |
替换完了,出现WebSocket connection to 'ws://0.0.0.0:8000/service' failed: 错误 |
是不是运行的时候没有加 -p 8080:8080 -p 8000:8000 -p 8899:8899 我这里完全没问题: docker run -d --name=sumi1 -p 8080:8080 -p 8000:8000 -p 8899:8899 sumi-core FROM node:lts as builder
# 用户工作空间,用于打包到前端工作空间地址
ENV WORKSPACE_DIR workspace
ENV EXTENSION_DIR extensions
ENV WEBIDE /app/webide
# 设置各种镜像和下载主机
ENV ELECTRON_MIRROR https://npmmirror.com/mirrors/electron/
ENV PUPPETEER_DOWNLOAD_HOST=https://cdn.npmmirror.com/binaries
ENV sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
ENV sharp_binary_host=https://mirrors.cloud.tencent.com/npm/sharp/-/sharp-0.31.1.tgz
ENV sentrycli_cdnurl=https://mirrors.cloud.tencent.com/npm/sentry-cli/
ENV electron_mirror=https://mirrors.cloud.tencent.com/npm/electron/
ENV chromedriver_cdnurl=https://mirrors.cloud.tencent.com/npm/chromedriver
ENV operadriver_cdnurl=https://mirrors.cloud.tencent.com/npm/operadriver
ENV python_mirror=https://pypi.tuna.tsinghua.edu.cn/simple/
ENV electron_builder_binaries_mirror=https://mirrors.cloud.tencent.com/npm/electron-builder-binaries/
ENV node_sqlite3_binary_host_mirror=https://mirrors.cloud.tencent.com/npm
ENV puppeteer_download_host=https://mirrors.cloud.tencent.com/npm
ENV sqlite3_binary_site=https://mirrors.cloud.tencent.com/npm/sqlite3/
ENV selenium_cdnurl=https://mirrors.cloud.tencent.com/npm/selenium
ENV node_inspector_cdnurl=https://mirrors.cloud.tencent.com/npm/node-inspector
# 创建目录
RUN mkdir -p ${WORKSPACE_DIR} &&\
mkdir -p ${EXTENSION_DIR}
RUN mkdir -p ${WEBIDE}
# 复制所有项目文件到${WEBIDE}
COPY . ${WEBIDE}
WORKDIR ${WEBIDE}
# 配置npm镜像
RUN yarn config set -H npmRegistryServer "https://registry.npmmirror.com" && \
yarn --network-timeout 1000000
# 安装必要的库
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libsecret-1-dev && \
rm -rf /var/lib/apt/lists/*
# 设置 PKG_CONFIG_PATH 环境变量
ENV PKG_CONFIG_PATH /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig
# 分步执行命令并增加日志输出
RUN yarn install && echo "yarn install completed"
RUN yarn run rebuild:node && echo "yarn run rebuild:node completed"
RUN yarn run init && echo "yarn run init completed"
EXPOSE 8080
EXPOSE 8000
EXPOSE 8899
ENV HOST 0.0.0.0
CMD [ "yarn", "start:remote" ]
|
就是这个命令 |
可以了 |
描述你的问题(Describe the bug)
按官方开发命令docker官方指导设置编译成功
1、docker服务器日志无错误
2、8000端口可以访问404错误
3、8080 端口、8899端口步不可以
复现路径(To Reproduce)
#docker文件
第一阶段:builder
FROM node:lts as builder
ENV WORKSPACE_DIR /workspace
ENV EXTENSION_DIR /root/.sumi/extensions
ENV EXT_MODE js
ENV NODE_ENV production
用户工作空间,用于打包到前端工作空间地址
ENV WEBIDE /app/webide
设置各种镜像和下载主机
ENV ELECTRON_MIRROR https://npmmirror.com/mirrors/electron/
ENV PUPPETEER_DOWNLOAD_HOST=https://cdn.npmmirror.com/binaries
ENV sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
ENV sharp_binary_host=https://mirrors.cloud.tencent.com/npm/sharp/-/sharp-0.31.1.tgz
ENV sentrycli_cdnurl=https://mirrors.cloud.tencent.com/npm/sentry-cli/
ENV electron_mirror=https://mirrors.cloud.tencent.com/npm/electron/
ENV chromedriver_cdnurl=https://mirrors.cloud.tencent.com/npm/chromedriver
ENV operadriver_cdnurl=https://mirrors.cloud.tencent.com/npm/operadriver
ENV python_mirror=https://pypi.tuna.tsinghua.edu.cn/simple/
ENV electron_builder_binaries_mirror=https://mirrors.cloud.tencent.com/npm/electron-builder-binaries/
ENV node_sqlite3_binary_host_mirror=https://mirrors.cloud.tencent.com/npm
ENV puppeteer_download_host=https://mirrors.cloud.tencent.com/npm
ENV sqlite3_binary_site=https://mirrors.cloud.tencent.com/npm/sqlite3/
ENV selenium_cdnurl=https://mirrors.cloud.tencent.com/npm/selenium
ENV node_inspector_cdnurl=https://mirrors.cloud.tencent.com/npm/node-inspector
创建目录
RUN mkdir -p ${WORKSPACE_DIR} &&
mkdir -p ${EXTENSION_DIR}
RUN mkdir -p ${WEBIDE}
复制所有项目文件到 ${WEBIDE}
COPY . ${WEBIDE}
WORKDIR ${WEBIDE}
配置 npm 镜像
RUN yarn config set -H npmRegistryServer "https://registry.npmmirror.com" &&
yarn --network-timeout 1000000
安装必要的库
RUN apt-get update &&
apt-get install -y --no-install-recommends
libsecret-1-dev &&
rm -rf /var/lib/apt/lists/*
设置 PKG_CONFIG_PATH 环境变量
ENV PKG_CONFIG_PATH /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig
分步执行命令并增加日志输出
RUN yarn install && echo "yarn install completed"
RUN yarn run rebuild:node && echo "yarn run rebuild:node completed"
RUN yarn run init && echo "yarn run init completed"
构建项目
RUN yarn run build && echo "yarn run build completed"
RUN yarn run download-extension && echo "yarn run download-extension completed"
第二阶段:app
FROM builder
暴露端口
EXPOSE 8080
EXPOSE 8000
EXPOSE 8899
ENV HOST 0.0.0.0
启动命令
CMD [ "yarn", "start" ]
环境信息(Environment)
第一阶段:builder
FROM node:lts as builder
ENV WORKSPACE_DIR /workspace
ENV EXTENSION_DIR /root/.sumi/extensions
ENV EXT_MODE js
ENV NODE_ENV production
用户工作空间,用于打包到前端工作空间地址
ENV WEBIDE /app/webide
设置各种镜像和下载主机
ENV ELECTRON_MIRROR https://npmmirror.com/mirrors/electron/
ENV PUPPETEER_DOWNLOAD_HOST=https://cdn.npmmirror.com/binaries
ENV sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
ENV sharp_binary_host=https://mirrors.cloud.tencent.com/npm/sharp/-/sharp-0.31.1.tgz
ENV sentrycli_cdnurl=https://mirrors.cloud.tencent.com/npm/sentry-cli/
ENV electron_mirror=https://mirrors.cloud.tencent.com/npm/electron/
ENV chromedriver_cdnurl=https://mirrors.cloud.tencent.com/npm/chromedriver
ENV operadriver_cdnurl=https://mirrors.cloud.tencent.com/npm/operadriver
ENV python_mirror=https://pypi.tuna.tsinghua.edu.cn/simple/
ENV electron_builder_binaries_mirror=https://mirrors.cloud.tencent.com/npm/electron-builder-binaries/
ENV node_sqlite3_binary_host_mirror=https://mirrors.cloud.tencent.com/npm
ENV puppeteer_download_host=https://mirrors.cloud.tencent.com/npm
ENV sqlite3_binary_site=https://mirrors.cloud.tencent.com/npm/sqlite3/
ENV selenium_cdnurl=https://mirrors.cloud.tencent.com/npm/selenium
ENV node_inspector_cdnurl=https://mirrors.cloud.tencent.com/npm/node-inspector
创建目录
RUN mkdir -p ${WORKSPACE_DIR} &&
mkdir -p ${EXTENSION_DIR}
RUN mkdir -p ${WEBIDE}
复制所有项目文件到 ${WEBIDE}
COPY . ${WEBIDE}
WORKDIR ${WEBIDE}
配置 npm 镜像
RUN yarn config set -H npmRegistryServer "https://registry.npmmirror.com" &&
yarn --network-timeout 1000000
安装必要的库
RUN apt-get update &&
apt-get install -y --no-install-recommends
libsecret-1-dev &&
rm -rf /var/lib/apt/lists/*
设置 PKG_CONFIG_PATH 环境变量
ENV PKG_CONFIG_PATH /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig
分步执行命令并增加日志输出
RUN yarn install && echo "yarn install completed"
RUN yarn run rebuild:node && echo "yarn run rebuild:node completed"
RUN yarn run init && echo "yarn run init completed"
构建项目
RUN yarn run build && echo "yarn run build completed"
RUN yarn run download-extension && echo "yarn run download-extension completed"
第二阶段:app
FROM builder
暴露端口
EXPOSE 8080
EXPOSE 8000
EXPOSE 8899
ENV HOST 0.0.0.0
启动命令
CMD [ "yarn", "start" ]
#Steps to reproduce the behavior:
预期表现(Expected behavior)
The text was updated successfully, but these errors were encountered: