Comments (4)
windows下只能使用volume,不能直接bind磁盘。
- 创建volume
docker volume create mongodata
docker volume create redisdata
docker volume create logsdata
- 将
docker-compose.yml
修改如下
version: "3.3"
services:
mongodb:
image: mongo:3.4
volumes:
- type: volume
source: mongodata
target: /data/db
redis:
image: redis:4.0.6
command: redis-server --appendonly yes
volumes:
- type: volume
source: redisdata
target: /data
web:
image: easymock/easymock:1.5.1
command: /bin/bash -c "npm start"
links:
- mongodb:mongodb
ports:
- 7300:7300
volumes:
- type: volume
source: logsdata # 日志地址,根据需要修改为本地地址
target: /home/easy-mock/easy-mock/logs
- type: bind
source: ./production.json # 配置地址,请使用本地配置地址替换
target: /home/easy-mock/easy-mock/config/production.json
# 一定要声明volumes
volumes:
mongodata:
external:
name: mongodata
redisdata:
external:
name: redisdata
logsdata:
external:
name: logsdata
- 删除
production.js
中的db
配置 - 运行
docker-compose up -d
from easy-mock-docker.
提供下
- 系统版本
- Docker 版本
- 使用子系统还是直接 Windows 版本 Docker
- easy-mock 镜像版本
我们看看是否可以复现。
from easy-mock-docker.
@DuanPengfei 使用的Windows 版本 Docker,貌似是因为Mongodb 不支持直接映射,只能使用具名volume
The default Docker setup on Windows and OS X uses a VirtualBox VM to host the Docker daemon. Unfortunately, the mechanism VirtualBox uses to share folders between the host system and the Docker container is not compatible with the memory mapped files used by MongoDB (see vbox bug, docs.mongodb.org and related jira.mongodb.org bug). This means that it is not possible to run a MongoDB container with the data directory mapped to the host.
from easy-mock-docker.
@CoinXu 感觉可以提个 PR 直接升级下原项目的 docker-compose 了,这样就可以尽最大可能兼容各种场景,让大家真正做到开箱即用😄
from easy-mock-docker.
Related Issues (20)
- macOS下启动不能启动web HOT 1
- 自定义部署路径 HOT 2
- 搜索团队会报错是什么原因呢? HOT 3
- web运行不起来 HOT 3
- 使用 network ! HOT 2
- docker镜像不维护了吗?easy-mock版本都4以上了 HOT 1
- docker-compose easymock 镜像版本问题 HOT 1
- docker-compose 部署时报文件权限错误 HOT 3
- docker-compose ps 一直在 Restarting HOT 1
- [ioredis] Unhandled error event: Error: connect ECONNREFUSED HOT 1
- 无法访问easy-mock问题 HOT 1
- docker部署运行出现: net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK) HOT 7
- easymock:1.6.0登录页加载失败
- 安装后,远程JS 加载失败,是不是需要更新下镜像代码了 HOT 1
- 1.3.3 镜像 up 之后提示访问,提示 window is not defined HOT 3
- npm start 时的权限问题 HOT 2
- 求一个CentOS7.x的docker-compose部署 HOT 2
- win10 使用docker部署不成功 HOT 1
- permission denied
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easy-mock-docker.