Created
June 16, 2023 19:29
-
-
Save Klerith/1a6a78e4cd4e86368d679bcfc55d9ec7 to your computer and use it in GitHub Desktop.
Postgres - Docker compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
todosDB: | |
image: postgres:15.3 | |
container_name: todos-db | |
restart: always | |
ports: | |
- 5432:5432 | |
environment: | |
- POSTGRES_USER=postgres | |
- POSTGRES_PASSWORD=postgres | |
volumes: | |
- ./postgres:/var/lib/postgresql/data |
Intenta cambiando el puerto a:
ports:
- 5433:5433
Buen día,
tenia el mismo inconveniente y lo solucione cambiando el archivo docker-compose.yml por:
version: '3.8'
services:
todosDB:
image: postgres:15.3
container_name: todos-db
restart: always
ports:
- '5432:5432'
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- postgres-data:/var/lib/postgresql/data
volumes:
postgres-data:
driver: local
y en la terminal ejecute:
docker-compose down -v
docker volume rm /ruta...
docker-compose up -d
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:5432 -> 0.0.0.0:0: listen tcp 0.0.0.0:5432: bind: address already in use, Tengo ese problema pero soy de mac y no me funciona la solución de eduardo, pls ayuda