Open StephanMeijer opened 6 years ago
If none of the above helped and you were sure that the port is free, you might consider removing all of your volumes, and turn on your containers again. I faced the same issue and removing the volumes brought me back on track!
docker-compose down -v
, where -v
will remove all of your volumesdocker-compose up --build
Also make sure you use the correct format;
services:
postgresql:
image: postgres:14-alpine
volumes:
- postgresql-storage:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=devpassword
- POSTGRES_USER=devuser
- POSTGRES_DB=devdb
- POSTGRES_HOST_AUTH_METHOD=trust
postgresql://devuser:devpassword@postgresql:5432/devdb