Giter VIP home page Giter VIP logo

Comments (4)

wyntau avatar wyntau commented on June 16, 2024

build

docker build -t ymfe-yapi .

run

此镜像只包含 yapi, 所以需要和 mongo 配合, 可以把 README 中的配置拷贝下来, 然后使用 docker-compose 运行即可

docker-compose up -d

from docker-ymfe-yapi.

yangguoquan avatar yangguoquan commented on June 16, 2024
➜  docker-ymfe-yapi git:(master) docker-compose up -d
Creating network "docker-ymfe-yapi_yapi" with the default driver
Pulling mongo (mongo:3)...
3: Pulling from library/mongo
4d0d76e05f3c: Already exists
2da2ecd7fdbd: Already exists
c3a86da34d0f: Already exists
e2b1f447e420: Already exists
c9e820834b36: Already exists
ffa34fa64bf4: Already exists
45ba5a2a5216: Pull complete
6024791f7c87: Pull complete
796e396ed72c: Pull complete
a4ac33c0a702: Pull complete
Digest: sha256:89672f72dde6ec88618fcfa2fd11a45d147cbd7df97573c227ff8d80131c3c53
Status: Downloaded newer image for mongo:3
Pulling yapi (wyntau/ymfe-yapi:)...
latest: Pulling from wyntau/ymfe-yapi
605ce1bd3f31: Already exists
ee0f5387267f: Already exists
a55aa6c4119a: Already exists
699a25577961: Pull complete
44fc042ede15: Pull complete
e2cd677d73bb: Pull complete
c85d814b5c58: Pull complete
Digest: sha256:b3aaabf993a9c8bb4eb398cc954b1782078923250a8d0234cbc00930303e7539
Status: Downloaded newer image for wyntau/ymfe-yapi:latest
Creating mongo ... done
Creating yapi  ... done
➜  docker-ymfe-yapi git:(master) ✗ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
80f142821e5e        wyntau/ymfe-yapi    "/sbin/tini -- /app/…"   28 seconds ago      Up About a minute   0.0.0.0:3000->3000/tcp   yapi
0f30af80f477        mongo:3             "docker-entrypoint.s…"   29 seconds ago      Up About a minute   27017/tcp                mongo

但是访问localhost:3000,服务没有没有启动

from docker-ymfe-yapi.

yangguoquan avatar yangguoquan commented on June 16, 2024
➜  docker-ymfe-yapi git:(master) ✗ docker-compose logs
Attaching to yapi, mongo
yapi     | =============================
yapi     | Install server after 6s.....
yapi     | =============================
yapi     | =============================
yapi     | Installing server ...........
yapi     | =============================
yapi     |
yapi     | > [email protected] install-server /app/vendors
yapi     | >  node server/install.js
yapi     |
yapi     | error: MongoError: Authentication failed., mongodb Authentication failed
yapi     | error: MongoError: Authentication failed.mongodb connect error
yapi     | (node:18) UnhandledPromiseRejectionWarning: Error: Authentication failed.
yapi     |     at /app/vendors/server/install.js:143:15
yapi     |     at <anonymous>
yapi     |     at process._tickCallback (internal/process/next_tick.js:188:7)
yapi     | (node:18) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
yapi     | (node:18) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
mongo    | about to fork child process, waiting until server is ready for connections.
mongo    | 2018-06-04T07:38:27.380+0000 I CONTROL  [main] ***** SERVER RESTARTED *****
mongo    | forked process: 23
mongo    | 2018-06-04T07:38:27.400+0000 I CONTROL  [initandlisten] MongoDB starting : pid=23 port=27017 dbpath=/data/db 64-bit host=0f30af80f477
mongo    | 2018-06-04T07:38:27.400+0000 I CONTROL  [initandlisten] db version v3.6.5
mongo    | 2018-06-04T07:38:27.400+0000 I CONTROL  [initandlisten] git version: a20ecd3e3a174162052ff99913bc2ca9a839d618
mongo    | 2018-06-04T07:38:27.400+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016
mongo    | 2018-06-04T07:38:27.400+0000 I CONTROL  [initandlisten] allocator: tcmalloc
mongo    | 2018-06-04T07:38:27.400+0000 I CONTROL  [initandlisten] modules: none
mongo    | 2018-06-04T07:38:27.400+0000 I CONTROL  [initandlisten] build environment:
mongo    | 2018-06-04T07:38:27.400+0000 I CONTROL  [initandlisten]     distmod: debian81
mongo    | 2018-06-04T07:38:27.400+0000 I CONTROL  [initandlisten]     distarch: x86_64
mongo    | 2018-06-04T07:38:27.400+0000 I CONTROL  [initandlisten]     target_arch: x86_64
mongo    | 2018-06-04T07:38:27.400+0000 I CONTROL  [initandlisten] options: { net: { bindIp: "127.0.0.1", port: 27017, ssl: { mode: "disabled" } }, processManagement: { fork: true, pidFilePath: "/tmp/docker-entrypoint-temp-mongod.pid" }, systemLog: { destination: "file", logAppend: true, path: "/proc/1/fd/1" } }
mongo    | 2018-06-04T07:38:27.411+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=487M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),cache_cursors=false,log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
mongo    | 2018-06-04T07:38:28.342+0000 I STORAGE  [initandlisten] WiredTiger message [1528097908:342535][23:0x7f2ebde7ba00], txn-recover: Set global recovery timestamp: 0
mongo    | 2018-06-04T07:38:28.401+0000 I CONTROL  [initandlisten]
mongo    | 2018-06-04T07:38:28.402+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
mongo    | 2018-06-04T07:38:28.402+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
mongo    | 2018-06-04T07:38:28.402+0000 I CONTROL  [initandlisten]
mongo    | 2018-06-04T07:38:28.406+0000 I STORAGE  [initandlisten] createCollection: admin.system.version with provided UUID: 1f98cc16-0a2d-47ec-97b9-9334d35b840d
mongo    | 2018-06-04T07:38:28.417+0000 I COMMAND  [initandlisten] setting featureCompatibilityVersion to 3.6
mongo    | 2018-06-04T07:38:28.423+0000 I STORAGE  [initandlisten] createCollection: local.startup_log with generated UUID: 4dfe93cf-df8d-46e6-9e75-893a4a98b573
mongo    | 2018-06-04T07:38:28.453+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
mongo    | 2018-06-04T07:38:28.454+0000 I NETWORK  [initandlisten] waiting for connections on port 27017
mongo    | child process started successfully, parent exiting
mongo    | 2018-06-04T07:38:28.750+0000 I NETWORK  [listener] connection accepted from 127.0.0.1:49984 #1 (1 connection now open)
mongo    | 2018-06-04T07:38:28.751+0000 I NETWORK  [conn1] received client metadata from 127.0.0.1:49984 conn1: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "3.6.5" }, os: { type: "Linux", name: "PRETTY_NAME="Debian GNU/Linux 8 (jessie)"", architecture: "x86_64", version: "Kernel 4.9.87-linuxkit-aufs" } }
mongo    | 2018-06-04T07:38:28.757+0000 I NETWORK  [conn1] end connection 127.0.0.1:49984 (0 connections now open)
mongo    | 2018-06-04T07:38:28.836+0000 I NETWORK  [listener] connection accepted from 127.0.0.1:49986 #2 (1 connection now open)
mongo    | 2018-06-04T07:38:28.837+0000 I NETWORK  [conn2] received client metadata from 127.0.0.1:49986 conn2: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "3.6.5" }, os: { type: "Linux", name: "PRETTY_NAME="Debian GNU/Linux 8 (jessie)"", architecture: "x86_64", version: "Kernel 4.9.87-linuxkit-aufs" } }
mongo    | 2018-06-04T07:38:28.859+0000 I STORAGE  [conn2] createCollection: admin.system.users with generated UUID: 954caf59-4874-468a-a807-3af0436f3ef9
mongo    | Successfully added user: {
mongo    | 	"user" : "yapi",
mongo    | 	"roles" : [
mongo    | 		{
mongo    | 			"role" : "root",
mongo    | 			"db" : "admin"
mongo    | 		}
mongo    | 	]
mongo    | }
mongo    | 2018-06-04T07:38:28.883+0000 E -        [main] Error saving history file: FileOpenFailed: Unable to open() file /home/mongodb/.dbshell: No such file or directory
mongo    | 2018-06-04T07:38:28.887+0000 I NETWORK  [conn2] end connection 127.0.0.1:49986 (0 connections now open)
mongo    |
mongo    | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
mongo    |
mongo    | killing process with pid: 23
mongo    | 2018-06-04T07:38:28.911+0000 I CONTROL  [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
mongo    | 2018-06-04T07:38:28.911+0000 I NETWORK  [signalProcessingThread] shutdown: going to close listening sockets...
mongo    | 2018-06-04T07:38:28.911+0000 I NETWORK  [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
mongo    | 2018-06-04T07:38:28.912+0000 I FTDC     [signalProcessingThread] Shutting down full-time diagnostic data capture
mongo    | 2018-06-04T07:38:28.912+0000 I STORAGE  [signalProcessingThread] WiredTigerKVEngine shutting down
mongo    | 2018-06-04T07:38:29.024+0000 I STORAGE  [signalProcessingThread] shutdown: removing fs lock...
mongo    | 2018-06-04T07:38:29.025+0000 I CONTROL  [signalProcessingThread] now exiting
mongo    | 2018-06-04T07:38:29.025+0000 I CONTROL  [signalProcessingThread] shutting down with code:0
mongo    |
mongo    | MongoDB init process complete; ready for start up.
mongo    |
mongo    | 2018-06-04T07:38:29.938+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=0f30af80f477
mongo    | 2018-06-04T07:38:29.939+0000 I CONTROL  [initandlisten] db version v3.6.5
mongo    | 2018-06-04T07:38:29.939+0000 I CONTROL  [initandlisten] git version: a20ecd3e3a174162052ff99913bc2ca9a839d618
mongo    | 2018-06-04T07:38:29.939+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016
mongo    | 2018-06-04T07:38:29.939+0000 I CONTROL  [initandlisten] allocator: tcmalloc
mongo    | 2018-06-04T07:38:29.939+0000 I CONTROL  [initandlisten] modules: none
mongo    | 2018-06-04T07:38:29.939+0000 I CONTROL  [initandlisten] build environment:
mongo    | 2018-06-04T07:38:29.939+0000 I CONTROL  [initandlisten]     distmod: debian81
mongo    | 2018-06-04T07:38:29.939+0000 I CONTROL  [initandlisten]     distarch: x86_64
mongo    | 2018-06-04T07:38:29.939+0000 I CONTROL  [initandlisten]     target_arch: x86_64
mongo    | 2018-06-04T07:38:29.939+0000 I CONTROL  [initandlisten] options: { net: { bindIpAll: true }, security: { authorization: "enabled" } }
mongo    | 2018-06-04T07:38:29.943+0000 I -        [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
mongo    | 2018-06-04T07:38:29.946+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=487M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),cache_cursors=false,log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
mongo    | 2018-06-04T07:38:32.044+0000 I STORAGE  [initandlisten] WiredTiger message [1528097912:44598][1:0x7f66de21aa00], txn-recover: Main recovery loop: starting at 1/19072
mongo    | 2018-06-04T07:38:32.659+0000 I STORAGE  [initandlisten] WiredTiger message [1528097912:659439][1:0x7f66de21aa00], txn-recover: Recovering log 1 through 2
mongo    | 2018-06-04T07:38:33.211+0000 I STORAGE  [initandlisten] WiredTiger message [1528097913:211958][1:0x7f66de21aa00], txn-recover: Recovering log 2 through 2
mongo    | 2018-06-04T07:38:33.317+0000 I STORAGE  [initandlisten] WiredTiger message [1528097913:317245][1:0x7f66de21aa00], txn-recover: Set global recovery timestamp: 0
mongo    | 2018-06-04T07:38:33.401+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
mongo    | 2018-06-04T07:38:33.402+0000 I NETWORK  [initandlisten] waiting for connections on port 27017
mongo    | 2018-06-04T07:38:36.135+0000 I NETWORK  [listener] connection accepted from 172.18.0.3:39802 #1 (1 connection now open)
mongo    | 2018-06-04T07:38:36.173+0000 I NETWORK  [conn1] received client metadata from 172.18.0.3:39802 conn1: { driver: { name: "nodejs", version: "2.2.11" }, os: { type: "Linux", name: "linux", architecture: "x64", version: "4.9.87-linuxkit-aufs" }, platform: "Node.js v8.11.2, LE, mongodb-core: 2.0.13" }
mongo    | 2018-06-04T07:38:36.187+0000 I ACCESS   [conn1] SCRAM-SHA-1 authentication failed for fdtyapi on admin from client 172.18.0.3:39802 ; UserNotFound: Could not find user fdtyapi@admin
mongo    | 2018-06-04T07:43:33.403+0000 I STORAGE  [thread2] createCollection: config.system.sessions with generated UUID: 47bb7bd4-b65d-42ab-812b-6a7e3974bd35
mongo    | 2018-06-04T07:43:33.419+0000 I INDEX    [thread2] build index on: config.system.sessions properties: { v: 2, key: { lastUse: 1 }, name: "lsidTTLIndex", ns: "config.system.sessions", expireAfterSeconds: 1800 }
mongo    | 2018-06-04T07:43:33.419+0000 I INDEX    [thread2] 	 building index using bulk method; build may temporarily use up to 500 megabytes of RAM
mongo    | 2018-06-04T07:43:33.421+0000 I INDEX    [thread2] build index done.  scanned 0 total records. 0 secs

from docker-ymfe-yapi.

yangguoquan avatar yangguoquan commented on June 16, 2024

是自己config.json里mongo的用户密码配置错了

from docker-ymfe-yapi.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.