Here is the dockerfile

version: '3' services: web: build: context: . dockerfile: Dockerfile ports: - "8000:8000" volumes: - .:/go/src/app command: go run main.go env_file: - .env depends_on: - db db: image: postgres:11 restart: always volumes: - db-data:/var/lib/postgresql/data ports: - "5432:5432" environment: - POSTGRES_DB=telegram - POSTGRES_USER=telegram - POSTGRES_PASSWORD=telegram volumes: db-data: driver: local 

Everything was fine, but on the same day without any changes in the code or docker-compose, everything fell with an error:

 performing post-bootstrap initialization ... ok db_1 | syncing data to disk ... ok db_1 | db_1 | WARNING: enabling "trust" authentication for local connections db_1 | You can change this by editing pg_hba.conf or using the option -A, or db_1 | --auth-local and --auth-host, the next time you run initdb. db_1 | db_1 | Success. You can now start the database server using: db_1 | db_1 | pg_ctl -D /var/lib/postgresql/data -l logfile start db_1 | db_1 | waiting for server to start....2019-04-12 19:45:50.046 UTC [40] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" db_1 | 2019-04-12 19:45:50.076 UTC [41] LOG: database system was shut down at 2019-04-12 19:45:49 UTC db_1 | 2019-04-12 19:45:50.082 UTC [40] LOG: database system is ready to accept connections db_1 | done db_1 | server started db_1 | CREATE DATABASE db_1 | db_1 | db_1 | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/* db_1 | db_1 | 2019-04-12 19:45:50.636 UTC [40] LOG: received fast shutdown request db_1 | waiting for server to shut down....2019-04-12 19:45:50.640 UTC [40] LOG: aborting any active transactions db_1 | 2019-04-12 19:45:50.646 UTC [40] LOG: background worker "logical replication launcher" (PID 47) exited with exit code 1 db_1 | 2019-04-12 19:45:50.647 UTC [42] LOG: shutting down db_1 | 2019-04-12 19:45:50.666 UTC [40] LOG: database system is shut down db_1 | done db_1 | server stopped db_1 | db_1 | PostgreSQL init process complete; ready for start up. db_1 | db_1 | 2019-04-12 19:45:50.771 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 db_1 | 2019-04-12 19:45:50.771 UTC [1] LOG: listening on IPv6 address "::", port 5432 db_1 | 2019-04-12 19:45:50.777 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" db_1 | 2019-04-12 19:45:50.803 UTC [58] LOG: database system was shut down at 2019-04-12 19:45:50 UTC db_1 | 2019-04-12 19:45:50.809 UTC [1] LOG: database system is ready to accept connections db_1 | 2019-04-12 19:45:52.314 UTC [66] FATAL: password authentication failed for user "postgres" db_1 | 2019-04-12 19:45:52.314 UTC [66] DETAIL: Role "postgres" does not exist. db_1 | Connection matched pg_hba.conf line 95: "host all all all md5" db_1 | 2019-04-12 19:45:52.754 UTC [67] FATAL: password authentication failed for user "postgres" db_1 | 2019-04-12 19:45:52.754 UTC [67] DETAIL: Role "postgres" does not exist. 

Nothing helps about re-creation, he refuses to see environment variables, although I’ll emphasize that everything worked fine before that

Tried to remove all containers and rebuild the assembly, the result is the same everywhere.

    0