Need help with easy-mock-docker?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

161 Stars 85 Forks 15 Commits 1 Opened issues

Services available


Need anything else?

Contributors list

docker-compose 文件内容

version: '3'

services: mongodb: image: mongo:3.4.1 volumes: # ./data/db 数据库文件存放地址,根据需要修改为本地地址 - './data/db:/data/db' networks: - easy-mock restart: always

redis: image: redis:4.0.6 command: redis-server --appendonly yes volumes: # ./data/redis redis 数据文件存放地址,根据需要修改为本地地址 - './data/redis:/data' networks: - easy-mock restart: always

web: image: easymock/easymock:1.6.0 command: /bin/bash -c "npm start" ports: - 7300:7300 volumes: # 日志地址,根据需要修改为本地地址 - './logs:/home/easy-mock/easy-mock/logs' # 配置地址,请使用本地配置地址替换 # - './production.json:/home/easy-mock/easy-mock/config/production.json' networks: - easy-mock restart: always

networks: easy-mock:


  1. 安装 docker-compose
  2. 新建文件
    并将上面 docker-compose 文件内容复制进入
  3. 启动:
    docker-compose up -d

自定义配置参考 easymock readme 中的配置小节。

注意 * 使用容器方式运行不需要指定

* production.json 配置中注意以下问题

  "port": 7300,
  "host": "",
  "pageSize": 30,
  "proxy": false,
  "db": "mongodb://mongodb/easy-mock" # host 请务必替换为mongodb, 而非 localhost
  "unsplashClientId": "",
  "redis": {
    "keyPrefix": "[Easy Mock]",
    "port": 6379,
    "host": "redis", // 请勿使用 localhost,换 "redis"
    "password": "",
    "db": 0
  • 如果遇到 easymock docker 实例报文件权限错误
    Error: EACCES: permission denied....
    chmod 777 /yourfile/logs

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.