-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitpod.yml
29 lines (28 loc) · 1.08 KB
/
.gitpod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
tasks:
- init: |
docker pull postgres:15.1
# open the readme.md document in VS code; note: thanks to the configuration in .vscode/settings.json, the document opens in markdown preview mode
gp open README.md
docker run -d -p 5432:5432 --name postgresDB15 -e POSTGRES_PASSWORD=welkom01 postgres:15.1 &&
sleep 5s &&
docker exec -i -u postgres postgresDB15 psql < .postgres/create_admin.sql &&
docker exec -i -u postgres postgresDB15 psql moviedb < tables.sql &&
sudo apt install -y postgresql-client
gp open POSTGRES.md
gp sync-done database-running
- name: start container and run a session as postgres owner
init: gp sync-await database-running
command: |
docker start postgresDB15 &&
sleep 1s &&
echo "Postgres is running at localhost port 5432, starting session" &&
#docker exec -it -u postgres postgresDB15 psql
PGPASSWORD=123456 psql -h 127.0.0.1 -U muser moviedb
ports:
- port: 5432
onOpen: ignore
visibility: private
vscode:
extensions:
- mtxr.sqltools
- mtxr.sqltools-driver-pg