4

I am a noob and I am trying to create a website following the tutorial from this guy: http://support.divio.com/academy/basic-how-to-build-a-website-and-blog-with-django-cms-60-minutes/introduction. It looks like I am stack at the part which I setup the local server of my project. When I do this a message appears on the power shell which says:

Waiting for local database server Couldn't connect to database container. 
Database server may not have started. 

I tried to find where the database is located but I couldn't do it. Does it have to do that I am using a windows OS and Linux containers?

4

2 回答 2

1

您可以通过运行以下命令检查数据库容器是否在本地运行:

docker ps

您应该会在输出中看到一个数据库容器:

... example_db_1

您可以通过以下方式检查正确的数据库是否可用且可从 Web 容器联系:

docker-compose run --rm web psql -h postgres -U postgres db
于 2018-09-05T10:57:49.373 回答
0

I had this same error and Divio support got back to me within just a few minutes to fix it.

Their fix was to basically to delete two lines from docker-compose.yml in your project directory so it reads:

version: "2"

services:
  web:
    build: "."
    links:
      - "db:postgres"
    ports:
      - "8000:80"
    volumes:
      - ".:/app:rw"
      - "./data:/data:rw"
    command: python manage.py runserver 0.0.0.0:80
    env_file: .env-local

  db:
    image: postgres:9.6-alpine
    environment:
      POSTGRES_DB: "db"
    volumes:
      - ".:/app:rw"

Then download the database again and restart the project. Hope that helps, and if not I can highly recommend contacting Divio support through their chat (bottom right of this page).

于 2018-12-10T17:01:06.430 回答