-
Notifications
You must be signed in to change notification settings - Fork 1
/
runPostgresql.sh
16 lines (16 loc) · 984 Bytes
/
runPostgresql.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
docker pull postgres:latest
docker run --name hotel-selection-postgres -e POSTGRES_PASSWORD=sven1 -e POSTGRES_USER=sven1 -e POSTGRES_DB=hotel_selection -p 5432:5432 -d postgres
docker run --name flight-selection-postgres -e POSTGRES_PASSWORD=sven1 -e POSTGRES_USER=sven1 -e POSTGRES_DB=flight_selection -p 5433:5432 -d postgres
docker run --name payment-postgres -e POSTGRES_PASSWORD=sven1 -e POSTGRES_USER=sven1 -e POSTGRES_DB=payment -p 5434:5432 -d postgres
# deprecated psql -h localhost -U sven1 -f src/main/resources/db/initDB.sql movies
# docker start hotel-selection-postgres
# docker stop hotel-selection-postgres
# docker start flight-selection-postgres
# docker stop flight-selection-postgres
# docker start payment-postgres
# docker stop payment-postgres
# docker exec -it hotel-selection-postgres bash
# docker exec -it flight-selection-postgres bash
# docker exec -it payment-postgres bash
# psql -h localhost -U sven1 -d flight-selection-postgres < initDB.sql