I have pulled the latest code from github, and built the docker.
When I run the command
docker-compose -f docker-compose.prod.yml up
the problem was as follows:
postgres_1 | 2021-01-26 10:37:55.287 UTC [1] FATAL: database files are incompatible with server
postgres_1 | 2021-01-26 10:37:55.287 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 12, which is not compatible with this version 13.1.
As your message says, the data directory initialized by PostgreSQL version 12 is incompatible with version 13.1.
If you want to update only frontend and backend, you can rewrite the PostgreSQL container version in docker-compose.prod.yml
as follows:
postgres:
image: postgres:12.0-alpine
# image: postgres:13.1-alpine
Ok, Thank you. But it will mean that I have to modify the file docker-compose.prod.yml
every time when I pull the code. So there is any plan for database upgrading?
As your message says, the data directory initialized by PostgreSQL version 12 is incompatible with version 13.1.
If you want to update only frontend and backend, you can rewrite the PostgreSQL container version indocker-compose.prod.yml
as follows:postgres: image: postgres:12.0-alpine # image: postgres:13.1-alpine
Sometimes, we should rebuild the image, so we can run this command:
docker-compose -f docker-compose.prod.yml build
and after that, we run the docker again by:
docker-compose -f docker-compose.prod.yml up
Most helpful comment
As your message says, the data directory initialized by PostgreSQL version 12 is incompatible with version 13.1.
If you want to update only frontend and backend, you can rewrite the PostgreSQL container version in
docker-compose.prod.yml
as follows: