fix(lab-05): align database lab with runtime behavior
This commit is contained in:
@@ -5,7 +5,10 @@
|
||||
### Da container nella stessa rete
|
||||
|
||||
```bash
|
||||
docker exec lab05-app psql -h db -U lab05_user -d lab05_db
|
||||
docker run --rm --network lab05-vpc-private \
|
||||
-e PGPASSWORD=lab05_password \
|
||||
postgres:16-alpine \
|
||||
psql -h db -U lab05_user -d lab05_db
|
||||
```
|
||||
|
||||
### Dall'host con port forwarding (non recommended)
|
||||
@@ -43,13 +46,15 @@ postgresql://lab05_user:lab05_password@127.0.0.1:5432/lab05_db
|
||||
Il database è in rete privata. Devi connetterti da container nella stessa rete:
|
||||
|
||||
```bash
|
||||
# Prima entra in un container
|
||||
docker exec -it lab05-app sh
|
||||
|
||||
# Poi connettiti
|
||||
psql -h db -U lab05_user -d lab05_db
|
||||
# Client temporaneo nella rete privata
|
||||
docker run --rm -it --network lab05-vpc-private \
|
||||
-e PGPASSWORD=lab05_password \
|
||||
postgres:16-alpine \
|
||||
psql -h db -U lab05_user -d lab05_db
|
||||
```
|
||||
|
||||
Nota: il servizio `lab05-app` usa `nginx:alpine` e non include `psql`.
|
||||
|
||||
### Password authentication failed
|
||||
|
||||
Verifica le credenziali in docker-compose.yml:
|
||||
|
||||
Reference in New Issue
Block a user