我正在尝试将使用MySQL映像的sails.js应用程序码头化,但出现错误。我尝试了来自stackoverflow和github的许多解决方案,但没有奏效。而且我对Docker没有任何经验。我的客户要求与之合作。这是我的docker-compose.yml
的代码version: '3'
services:
sailsjs:
build:
context: .
dockerfile: Dockerfile
ports:
- 80:1337
volumes:
- .:/usr/src/app
mysqlsails:
image: mysql
environment:
MYSQL_ROOT_PASSWORD:
MYSQL_DATABASE: pricing_engine
MYSQL_USER: root
MYSQL_PASSWORD:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
volumes:
- mysql-data:/var/lib/mysql
volumes:
mysql-data:
和datastores.js
module.exports.datastores = {
default: {
adapter: require('sails-mysql'),
host: 'mysqlsails',
user: 'root',
password: '',
database: 'pricing_engine',
insecureAuth : true
},
};