IITII / pic_online

局域网媒体浏览服务, 图片, 漫画, 视频,,,
https://iitii.github.io/pic_online/
MIT License
23 stars 1 forks source link

请问,怎么样通过docker-compose一键部署 #3

Closed yyqAlisa closed 1 year ago

IITII commented 1 year ago

目前没折腾,我考虑下

IITII commented 1 year ago
wget https://raw.githubusercontent.com/IITII/pic_online_backend/main/docker-compose.yml
docker-compose up -d
yyqAlisa commented 1 year ago

一直重启,运行报错如下:

[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

IITII commented 1 year ago

文件夹映射问题?你子目录里面有软链?

docker-compose logs > log.log 还有启动命令都贴出来 你也可以手动把 entrypoint 改成bash 手动去访问目录, 看看是否正常

zolagz commented 1 year ago

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: pic_online | [2023-06-26T01:36:54.635Z] INFO pic/BROKER: Node ID: pic pic_online | [2023-06-26T01:36:54.636Z] INFO pic/REGISTRY: Strategy: RoundRobinStrategy pic_online | [2023-06-26T01:36:54.636Z] INFO pic/REGISTRY: Discoverer: LocalDiscoverer pic_online | [2023-06-26T01:36:54.640Z] INFO pic/BROKER: Cacher: MemoryCacher pic_online | [2023-06-26T01:36:54.640Z] INFO pic/BROKER: Serializer: JSONSerializer pic_online | [2023-06-26T01:36:54.648Z] INFO pic/BROKER: Validator: FastestValidator pic_online | [2023-06-26T01:36:54.649Z] INFO pic/TRACER: Tracing: Enabled pic_online | [2023-06-26T01:36:54.650Z] INFO pic/TRACER: Tracing exporter: ConsoleTraceExporter pic_online | [2023-06-26T01:36:54.653Z] INFO pic/BROKER: Registered 14 middleware(s). pic_online | [2023-06-26T01:36:54.769Z] INFO pic/API: API Gateway server created. pic_online | [2023-06-26T01:36:54.770Z] INFO pic/API: Register route to '/limit' pic_online | [2023-06-26T01:36:54.783Z] INFO pic/API: ♻ Generate aliases for '/limit' route... pic_online | [2023-06-26T01:36:54.783Z] INFO pic/API: pic_online | [2023-06-26T01:36:54.784Z] INFO pic/API: Register route to '/dev' pic_online | [2023-06-26T01:36:54.784Z] INFO pic/API: ♻ Generate aliases for '/dev' route... pic_online | [2023-06-26T01:36:54.784Z] INFO pic/API: pic_online | [2023-06-26T01:36:54.784Z] INFO pic/API: Register route to '/admin' pic_online | [2023-06-26T01:36:54.788Z] INFO pic/API: ♻ Generate aliases for '/admin' route... pic_online | [2023-06-26T01:36:54.788Z] INFO pic/API: pic_online | [2023-06-26T01:36:54.788Z] INFO pic/API: Register route to '/api' pic_online | [2023-06-26T01:36:54.789Z] INFO pic/API: ♻ Generate aliases for '/api' route... pic_online | [2023-06-26T01:36:54.789Z] INFO pic/API: pic_online | [2023-06-26T01:36:54.965Z] INFO pic/REGISTRY: '$node' service is registered. pic_online | [2023-06-26T01:36:54.974Z] WARN pic/FILE: Read finish, time: 0.01s dir: 0, file: 0, dir: /pic/data/images pic_online | [2023-06-26T01:36:54.975Z] WARN pic/FILE: Deal finish, time: 0.01s pic_online | [2023-06-26T01:36:54.975Z] INFO pic/$NODE: Service '$node' started. pic_online | [2023-06-26T01:36:54.976Z] WARN pic/FILE: Cache init failed: Unexpected end of JSON input pic_online | [2023-06-26T01:36:54.977Z] WARN pic/FILE: Read finish, time: 0.00s dir: 0, file: 0, dir: /pic/data/video pic_online | [2023-06-26T01:36:54.977Z] WARN pic/FILE: Deal finish, time: 0.00s pic_online | [2023-06-26T01:36:54.982Z] INFO pic/REGISTRY: 'file' service is registered. pic_online | [2023-06-26T01:36:54.982Z] INFO pic/FILE: Service 'file' started. pic_online | [2023-06-26T01:36:54.983Z] INFO pic/API: API Gateway listening on http://0.0.0.0:8089 pic_online | [2023-06-26T01:36:54.985Z] INFO pic/REGISTRY: 'api' service is registered. pic_online | [2023-06-26T01:36:54.986Z] INFO pic/API: Service 'api' started. pic_online | node:events:491 pic_online | throw er; // Unhandled 'error' event pic_online | ^ pic_online | pic_online | Error: EISDIR: illegal operation on a directory, read pic_online | Emitted 'error' event on ReadStream instance at: pic_online | at emitErrorNT (node:internal/streams/destroy:151:8) pic_online | at emitErrorCloseNT (node:internal/streams/destroy:116:3) pic_online | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { pic_online | errno: -21, pic_online | code: 'EISDIR', pic_online | syscall: 'read' pic_online | } pic_online | pic_online | Node.js v18.16.1 pic_online | pic_online | > pic_online_backend@1.0.0 start pic_online | > node App.js pic_online | pic_online | [2023-06-26T01:36:56.412Z] INFO pic/BROKER: Moleculer v0.14.29 is starting... pic_online | [2023-06-26T01:36:56.414Z] INFO pic/BROKER: Namespace:

yyqAlisa commented 1 year ago

构建镜像:

docker build -t iitii/pic_online .

运行实例:

docker run -itd --name pic001 -p 8089:8089 iitii/pic_online:latest

访问http://ip:8089/pic 这样是可以运行的。 就是通过docker-compose启动报上面的错,一直重启

yyqAlisa commented 1 year ago

通过如下命令启动,图片加载不出来 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
IITII commented 1 year ago

需要指定 NAS_DOMAIN 为实际 ip 或者 域名. ip 推荐为容器 ip. 如果是 host 模式, 可以写宿主机 ip

IITII commented 1 year ago

我更新了 compose 文件和 镜像, 待会重新拉取下试试吧 @zolagz @yyqAlisa