I try to run Django project in Docker container. Until now, everything was working fine. I didn't change anything but I get error shown at the bottom. Any ideas what is wrong? My PostgreSQL settings look in this way:
DATABASES = {
"default":
{
'ENGINE': 'django.db.backends.postgresql',
"NAME": 'myproject',
"HOST": "db",
"PORT": "5432",
}
}
DATABASES = {'default': dj_database_url.config(default='postgres://addw...@ec2-31-11-107-127.compute-1.amazonaws.com:5432/qdsfks')}
docker-compose.yml:
version: '3'
services:
db:
image: postgres
environment:
POSTGRES_USER: myproject
POSTGRES_PASSWORD: somepass
volumes:
- "./local_pgdata:/var/lib/postgresql/data/pgdata"
django:
build: .
command: python3 manage.py runserver 0.0.0.0:8001
volumes:
- .:/code
ports:
- "8001:8001"
depends_on:
- db
Logs:
db_1 | The files belonging to this database system will be owned by user "postgres".
db_1 | This user must also own the server process.
db_1 |
db_1 | The database cluster will be initialized with locale "en_US.utf8".
db_1 | The default database encoding has accordingly been set to "UTF8".
db_1 | The default text search configuration will be set to "english".
db_1 |
db_1 | Data page checksums are disabled.
db_1 |
db_1 | initdb: directory "/var/lib/postgresql/data" exists but is not empty
db_1 | If you want to create a new database system, either remove or empty
db_1 | the directory "/var/lib/postgresql/data" or run initdb
db_1 | with an argument other than "/var/lib/postgresql/data".