Closed yyqAlisa closed 1 year ago
wget https://raw.githubusercontent.com/IITII/pic_online_backend/main/docker-compose.yml
docker-compose up -d
一直重启,运行报错如下:
[2023-06-25T12:20:22.754Z] INFO pic/$NODE: Service '$node' started. [2023-06-25T12:20:22.754Z] WARN pic/FILE: Deal finish, time: 0.02s [2023-06-25T12:20:22.758Z] WARN pic/FILE: Read finish, time: 0.00s dir: 0, file: 0, dir: /pic/data/video [2023-06-25T12:20:22.758Z] WARN pic/FILE: Deal finish, time: 0.00s [2023-06-25T12:20:22.765Z] INFO pic/REGISTRY: 'file' service is registered. [2023-06-25T12:20:22.765Z] INFO pic/FILE: Service 'file' started. [2023-06-25T12:20:22.766Z] INFO pic/API: API Gateway listening on http://0.0.0.0:8089 [2023-06-25T12:20:22.767Z] INFO pic/REGISTRY: 'api' service is registered. [2023-06-25T12:20:22.768Z] INFO pic/API: Service 'api' started. node:events:491 throw er; // Unhandled 'error' event ^
Error: EISDIR: illegal operation on a directory, read Emitted 'error' event on ReadStream instance at: at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { errno: -21, code: 'EISDIR', syscall: 'read' }
Node.js v18.16.1
文件夹映射问题?你子目录里面有软链?
docker-compose logs > log.log 还有启动命令都贴出来 你也可以手动把 entrypoint 改成bash 手动去访问目录, 看看是否正常
pic_online |
pic_online | > pic_online_backend@1.0.0 start
pic_online | > node App.js
pic_online |
pic_online | [2023-06-26T01:36:54.632Z] INFO pic/BROKER: Moleculer v0.14.29 is starting...
pic_online | [2023-06-26T01:36:54.634Z] INFO pic/BROKER: Namespace:
构建镜像:
docker build -t iitii/pic_online .
运行实例:
docker run -itd --name pic001 -p 8089:8089 iitii/pic_online:latest
访问http://ip:8089/pic 这样是可以运行的。 就是通过docker-compose启动报上面的错,一直重启
通过如下命令启动,图片加载不出来 docker run -itd --name pic_online1 -p 8089:8089 -v /home/user01/images:/pic/data/images -e MOLECULER_DDNS_ENABLE:false iitii/pic_online:latest
Uncaught (in promise) Error: Image failed to load!And failed src was: http://0.0.0.0:8089/images/5_008.jpg
at vendor.571e4b47.js:62:75741
at Z._log (vendor.571e4b47.js:62:76377)
at vendor.571e4b47.js:62:75724
(anonymous) @ vendor.571e4b47.js:62
_log @ vendor.571e4b47.js:62
(anonymous) @ vendor.571e4b47.js:62
Promise.catch (async)
_setImageSrc @ vendor.571e4b47.js:62
(anonymous) @ vendor.571e4b47.js:62
(anonymous) @ vendor.571e4b47.js:62
vendor.571e4b47.js:62 Uncaught (in promise) Error: Image failed to load!And failed src was: http://0.0.0.0:8089/images/5_010.jpg
at vendor.571e4b47.js:62:75741
at Z._log (vendor.571e4b47.js:62:76377)
at vendor.571e4b47.js:62:75724
需要指定 NAS_DOMAIN 为实际 ip 或者 域名. ip 推荐为容器 ip. 如果是 host 模式, 可以写宿主机 ip
我更新了 compose 文件和 镜像, 待会重新拉取下试试吧 @zolagz @yyqAlisa
目前没折腾,我考虑下