我正在尝试迁移数据,但始终找不到我的 postgreSQL。
version: '3'
services:
server:
build: ./server
ports:
- 3002:3002
depends_on:
- db
environment:
CORS_ALLOW_ORIGINS: http://localhost:8080,http://localhost:80
PORT: 3002
DEBUG: vuichoi*
DEBUG_HIDE_DATE: 1
SECRET_OR_PRIVATE_KEY: secret
SECRET_OR_PUBLIC_KEY: secret
DATABASE_URL: postgres://vuichoi:@db:5432/vuichoi #point the server container to the db container's IP address
command: bash -c "sequelize db:migrate && sequelize db:seed:all"
db:
ports:
- 5432:5432
environment:
POSTGRES_USER: vuichoi
POSTGRES_DB: vuichoi
image: postgres:10
Run Code Online (Sandbox Code Playgroud)
配置文件
{
"development": {
"username": "vuichoi",
"database": "vuichoi",
"host": "localhost",
"dialect": "postgres"
},
"test": {
"username": "vuichoi",
"password": "vuichoi",
"database": "database_test",
"host": …Run Code Online (Sandbox Code Playgroud)