Closed accat7080 closed 1 year ago
启动看着没问题,但是浏览器访问不了
做了些改动 [root@tool-10-0-0-13 tl-rtc-file]# cat Dockerfile FROM node:14
WORKDIR /home/tlrtcfile
ADD . ./
COPY sources.list /etc/apt/sources.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 && apt update && apt install -y libxtst-dev && npm conf set registry https://registry.npm.taobao.org/ && npm install -g pm2 && cd /home/tlrtcfile/svr/ && npm install && cd /home/tlrtcfile/svr/build/webpack/ && npm install
EXPOSE 9092 8444
CMD ["/bin/sh", "docker-entrypoint.sh"
[root@tool-10-0-0-13 tl-rtc-file]# cat docker-entrypoint.sh #!/bin/bash
cd /home/tlrtcfile/svr
pm2 start npm --name=tlsocket -- run ssocket pm2 start npm --name=tlapi -- run sapi
cd build/webpack
pm2 start npm --name=tlbuild -- run pro
pm2 logs --lines 1000
数据库连接已添加
暂时把sapi, ssocket替换为 lapi, lsocket就好,后面我优化一下这个地方
启动看着没问题,但是浏览器访问不了
做了些改动 [root@tool-10-0-0-13 tl-rtc-file]# cat Dockerfile FROM node:14
WORKDIR /home/tlrtcfile
ADD . ./
COPY sources.list /etc/apt/sources.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 && \ apt update && \ apt install -y libxtst-dev && \ npm conf set registry https://registry.npm.taobao.org/ && \ npm install -g pm2 && \ cd /home/tlrtcfile/svr/ && \ npm install && \ cd /home/tlrtcfile/svr/build/webpack/ && \ npm install
EXPOSE 9092 8444
CMD ["/bin/sh", "docker-entrypoint.sh"
[root@tool-10-0-0-13 tl-rtc-file]# cat docker-entrypoint.sh
!/bin/bash
cd /home/tlrtcfile/svr
pm2 start npm --name=tlsocket -- run ssocket pm2 start npm --name=tlapi -- run sapi
cd build/webpack
pm2 start npm --name=tlbuild -- run pro
pm2 logs --lines 1000
数据库连接已添加