Infrastructure Initialization
Prepare the underlying storage layer before configuring the application server. YApi requires a persistent MongoDB instance to store workspace metadata, user accounts, and endpoint definitions.
docker pull mongo:latest
docker run -d \
--name yapi_mongo_vault \
--restart unless-stopped \
-p 27017:27017 \
-v /opt/mongo/storage:/data/db \
-e MONGO_INITDB_ROOT_USERNAME=vault_admin \
-e MONGO_INITDB_ROOT_PASSWORD=V@ult_Str0ng_Pass \
-e MONGO_INITDB_DATABASE=yapi_workspace \
mongo:latest
The provided environment variables establish root authentication credentials and designate the target collection space. Persistnet volume mapping guarantees dataset integrity across container lifecycles.
Application Server Configuraton
Retrieve the YApi runtime image and bind it to the host network stack. Map the database connection parameters alongside administrative access controls.
docker pull jayfong/yapi:latest
docker run -d \
--name yapi_gateway \
--restart unless-stopped \
-p 8080:3000 \
-e YAPI_ADMIN_ACCOUNT=sysops@techteam.dev \
-e YAPI_ADMIN_PASSWORD=Gw@rd_Pr0t0c0l! \
-e YAPI_CLOSE_REGISTER=true \
-e YAPI_DB_SERVERNAME=127.0.0.1 \
-e YAPI_DB_PORT=27017 \
-e YAPI_DB_DATABASE=yapi_workspace \
-e YAPI_MAIL_ENABLE=false \
-e YAPI_PLUGINS=[] \
-e YAPI_DB_USER=vault_admin \
-e YAPI_DB_PASS=V@ult_Str0ng_Pass \
-e YAPI_DB_AUTH_SOURCE=admin \
jayfong/yapi:latest
Critical directives disable external registration flows, route traffic to the designated database port, and supply the previously generated authentication tokens. The internal Node.js process operates on port 3000, proxied to host port 8080.
Interface Verification
Validate the deployment sequence by routing HTTP requests to the mapped endpoint.
http://<host_ip>:8080
Enter the system operator credentials configured during container launch. Successful authentication triggers the primary dashboard, where workspace projetcs and API schemas can be immediately provisioned.