Docker-compose无法找到模块

时间:2018-06-28 13:04:27

标签: javascript node.js database docker npm

我一直在尝试重写某些docker-compose.yml文件,以将其从mongodb更改为mysql,但是每次安装新的依赖项时,它都表示找不到它...

Cannot find module 'sequelize'

我已经尝试过docker-compose构建,但是无法正常工作。我相当确定这与我的docker-compose.yml文件有关。

version: '3'
services:

  web:
    build: .
    ports:
     - "3001:3000"
    environment:
     - MONGODB_URI=mongodb://mongo:27017/test
    links:
     - database
    depends_on:
     - database
    volumes:
     - .:/starter
     - /starter/node_modules

  database:
    image: mysql
    environment:
      MYSQL_DATABASE: "ticketgo"
      MYSQL_ROOT_PASSWORD: "pass"
    ports:
     - "3306:3306"

  adminer:
    image: "adminer"
    ports:
     - "8080:8080"
    links:
     - "database"

1 个答案:

答案 0 :(得分:1)

尝试以下命令:

docker-compose down
docker-compose up --build