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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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