Skip to content

Instantly share code, notes, and snippets.

@Klerith
Last active November 6, 2025 20:54
Show Gist options
  • Save Klerith/8cfc637868212cfb888333ecaa6080e1 to your computer and use it in GitHub Desktop.
Save Klerith/8cfc637868212cfb888333ecaa6080e1 to your computer and use it in GitHub Desktop.
Tarea sobre PGAdmin y Postgres

Docker Hub images

Postgres

pgAdmin

1. Crear un volumen para almacenar la información de la base de datos

docker COMANDO CREAR postgres-db

2. Montar la imagen de postgres así

OJO: No hay puerto publicado -p, lo que hará imposible acceder a la base de datos con TablePlus

docker container run \
-d \
--name postgres-db \
-e POSTGRES_PASSWORD=123456 \
-v postgres-db:/PATH/DE/LA/BASE/DE/DATOS \
postgres:15.1

Powershell

docker container run `
-d `
--name postgres-db `
-e POSTGRES_PASSWORD=123456 `
-v postgres-db:/PATH/DE/LA/BASE/DE/DATOS `
postgres:15.1

3. Tomar pgAdmin de aquí

docker container run \
--name pgAdmin \
-e PGADMIN_DEFAULT_PASSWORD=123456 \
-e [email protected] \
-dp 8080:80 \
dpage/pgadmin4:6.17

Powershell

docker container run `
--name pgAdmin `
-e PGADMIN_DEFAULT_PASSWORD=123456 `
-e [email protected] `
-dp 8080:80 `
dpage/pgadmin4:6.17

4. Ingresar a la web con las credenciales de superman

http://localhost:8080/

5. Intentar crear la conexión a la base de datos

  1. Click en Servers
  2. Click en Register > Server
  3. Colocar el nombre de: "SuperHeroesDB" (el nombre no importa)
  4. Ir a la pestaña de connection
  5. Colocar el hostname "postgres-db" (el mismo nombre que le dimos al contenedor)
  6. Username es "postgres" y el password: 123456
  7. Probar la conexión

6. Ohhh no!, no vemos la base de datos, se nos olvidó la red

7. Crear la red

docker network ALGO PARA CREAR postgres-net

8. Asignar ambos contenedores a la red

docker container ALGO PARA LISTAR LOS CONTENEDORES

9. Conectar ambos contenedores

docker network connect postgres-net ID del contenedor 1

docker network connect postgres-net ID del contenedor 2

10. Intentar el paso 4. de nuevo.

Si logra establecer la conexión, todo está correcto, proceder a crear una base de datos, schemas, tablas, insertar registros, lo que sea.

11. Saltar de felicidad

happy

@markconfig
Copy link

Misión cumplida !

image

@ismaelgt24
Copy link

ismaelgt24 commented Aug 31, 2025

Logrado!!
image

@fcaldarola-psal
Copy link

Se pudooo
image

@DerianMolinaLopez
Copy link

Si se pudo
image

@marcosbondel
Copy link

Se logró 💪🏼

Screenshot 2025-09-14 at 1 20 56 PM

@andj05
Copy link

andj05 commented Sep 16, 2025

listo

imagen_2025-09-16_112632846

@D1ef0
Copy link

D1ef0 commented Sep 19, 2025

image

@AlejandroMolanoL
Copy link

1

@iOorch
Copy link

iOorch commented Sep 30, 2025

image

@anthonyTeran
Copy link

image

@gubiarpa
Copy link

gubiarpa commented Nov 1, 2025

Go! Go! Go!
image

@AndresFelipe077
Copy link

Listo quedo!!! 👌👍🦾

image

@MickePrado-DEV
Copy link

Screenshot 2025-11-05 at 12 59 56 p m si se pudo!

@lbertel
Copy link

lbertel commented Nov 6, 2025

done
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment