Skip to content

Commit 8bf5a38

Browse files
feat : add pgadmin for Viewing database
1 parent 66dacc6 commit 8bf5a38

File tree

4 files changed

+59
-181
lines changed

4 files changed

+59
-181
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626

2727
// Use 'forwardPorts' to make a list of ports inside the container available locally.
28-
// "forwardPorts": [],
28+
"forwardPorts": [8080],
2929

3030
// Use 'postCreateCommand' to run commands after the container is created.
3131
"postCreateCommand": "java -version"

.vscode/launch.json

Lines changed: 2 additions & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -6,180 +6,13 @@
66
"configurations": [
77
{
88
"type": "java",
9-
"name": "MultiDataSourceMultiTenancyApplicationTest",
10-
"request": "launch",
11-
"mainClass": "com.example.multitenancy.MultiDataSourceMultiTenancyApplicationTest",
12-
"projectName": "multidatasource-multitenancy"
13-
},
14-
{
15-
"type": "java",
16-
"name": "Spring Boot-Application<boot-reactive-cache>",
17-
"request": "launch",
18-
"cwd": "${workspaceFolder}",
19-
"mainClass": "com.example.cache.Application",
20-
"projectName": "boot-reactive-cache",
21-
"args": "",
22-
"envFile": "${workspaceFolder}/.env"
23-
},
24-
{
25-
"type": "java",
26-
"name": "Spring Boot-Application<boot-graphql-webmvc>",
27-
"request": "launch",
28-
"cwd": "${workspaceFolder}",
29-
"mainClass": "com.example.graphql.Application",
30-
"projectName": "boot-graphql-webmvc",
31-
"args": "--spring.profiles.active=local",
32-
"envFile": "${workspaceFolder}/.env"
33-
},
34-
{
35-
"type": "java",
36-
"name": "Spring Boot-StrategyPluginApplication<boot-strategy-plugin>",
37-
"request": "launch",
38-
"cwd": "${workspaceFolder}",
39-
"mainClass": "com.example.plugin.strategyplugin.StrategyPluginApplication",
40-
"projectName": "boot-strategy-plugin",
41-
"args": "",
42-
"envFile": "${workspaceFolder}/.env"
43-
},
44-
{
45-
"type": "java",
46-
"name": "Spring Boot-Application<boot-data-envers>",
47-
"request": "launch",
48-
"cwd": "${workspaceFolder}",
49-
"mainClass": "com.example.envers.Application",
50-
"projectName": "boot-data-envers",
51-
"args": "--spring.profiles.active=local",
52-
"envFile": "${workspaceFolder}/.env"
53-
},
54-
{
55-
"type": "java",
56-
"name": "Spring Boot-Application<boot-mongodb-elasticsearch>",
57-
"request": "launch",
58-
"cwd": "${workspaceFolder}",
59-
"mainClass": "com.example.mongoes.MongoESApplication",
60-
"projectName": "boot-mongodb-elasticsearch",
61-
"args": "--spring.profiles.active=cluster",
62-
"envFile": "${workspaceFolder}/.env"
63-
},
64-
{
65-
"type": "java",
66-
"name": "Spring Boot-Application<boot-jooq-r2dbc-sample>",
67-
"request": "launch",
68-
"cwd": "${workspaceFolder}",
69-
"mainClass": "com.example.jooq.r2dbc.Application",
70-
"projectName": "boot-jooq-r2dbc-sample",
71-
"args": "--spring.profiles.active=local",
72-
"envFile": "${workspaceFolder}/.env"
73-
},
74-
{
75-
"type": "java",
76-
"name": "Spring Boot-TestApplication<boot-data-envers>",
9+
"name": "Spring Boot-JpaEnversApplication<boot-data-envers>",
7710
"request": "launch",
7811
"cwd": "${workspaceFolder}",
79-
"mainClass": "com.example.envers.TestApplication",
12+
"mainClass": "com.example.envers.JpaEnversApplication",
8013
"projectName": "boot-data-envers",
81-
"args": "",
82-
"envFile": "${workspaceFolder}/.env"
83-
},
84-
{
85-
"type": "java",
86-
"name": "Spring Boot-TestUltimateRedisApplication<boot-ultimate-redis>",
87-
"request": "launch",
88-
"cwd": "${workspaceFolder}",
89-
"mainClass": "com.example.ultimateredis.TestUltimateRedisApplication",
90-
"projectName": "boot-ultimate-redis",
91-
"args": "",
92-
"envFile": "${workspaceFolder}/.env"
93-
},
94-
{
95-
"type": "java",
96-
"name": "Spring Boot-UltimateRedisApplication<boot-ultimate-redis>",
97-
"request": "launch",
98-
"cwd": "${workspaceFolder}",
99-
"mainClass": "com.example.ultimateredis.UltimateRedisApplication",
100-
"projectName": "boot-ultimate-redis",
101-
"args": "",
102-
"envFile": "${workspaceFolder}/.env"
103-
},
104-
{
105-
"type": "java",
106-
"name": "Spring Boot-TestApplication<boot-http-proxy>",
107-
"request": "launch",
108-
"cwd": "${workspaceFolder}",
109-
"mainClass": "com.example.rest.proxy.TestApplication",
110-
"projectName": "boot-http-proxy",
111-
"args": "",
112-
"envFile": "${workspaceFolder}/.env"
113-
},
114-
{
115-
"type": "java",
116-
"name": "Spring Boot-TestApplication<boot-graphql-webflux>",
117-
"request": "launch",
118-
"cwd": "${workspaceFolder}",
119-
"mainClass": "com.example.graphql.TestApplication",
120-
"projectName": "boot-graphql-webflux",
121-
"args": "",
122-
"envFile": "${workspaceFolder}/.env"
123-
},
124-
{
125-
"type": "java",
126-
"name": "Spring Boot-Application<boot-shedlock-sample>",
127-
"request": "launch",
128-
"cwd": "${workspaceFolder}",
129-
"mainClass": "com.learning.shedlock.Application",
130-
"projectName": "boot-shedlock-sample",
131-
"args": "--spring.profiles.active=local",
132-
"envFile": "${workspaceFolder}/.env"
133-
},
134-
{
135-
"type": "java",
136-
"name": "Spring Boot-TestApplication<boot-hibernate2ndlevelcache-sample>",
137-
"request": "launch",
138-
"cwd": "${workspaceFolder}",
139-
"mainClass": "com.example.hibernatecache.TestApplication",
140-
"projectName": "boot-hibernate2ndlevelcache-sample",
141-
"args": "",
142-
"envFile": "${workspaceFolder}/.env"
143-
},
144-
{
145-
"type": "java",
146-
"name": "Spring Boot-TestApplication<batch-boot-jpa-sample>",
147-
"request": "launch",
148-
"cwd": "${workspaceFolder}",
149-
"mainClass": "com.example.bootbatchjpa.TestApplication",
150-
"projectName": "batch-boot-jpa-sample",
151-
"args": "",
152-
"envFile": "${workspaceFolder}/.env"
153-
},
154-
{
155-
"type": "java",
156-
"name": "Spring Boot-Application<boot-jndi-sample>",
157-
"request": "launch",
158-
"cwd": "${workspaceFolder}",
159-
"mainClass": "com.example.jndi.Application",
160-
"projectName": "boot-jndi-sample",
16114
"args": "--spring.profiles.active=local",
16215
"envFile": "${workspaceFolder}/.env"
163-
},
164-
{
165-
"type": "java",
166-
"name": "Spring Boot-Application<multidatasource-multitenancy>",
167-
"request": "launch",
168-
"cwd": "${workspaceFolder}",
169-
"mainClass": "com.example.multitenancy.MultiDataSourceMultiTenancyApplication",
170-
"projectName": "multidatasource-multitenancy",
171-
"args": "",
172-
"envFile": "${workspaceFolder}/.env"
173-
},
174-
{
175-
"type": "java",
176-
"name": "Spring Boot-TestMongoESApplication<boot-mongodb-elasticsearch>",
177-
"request": "launch",
178-
"cwd": "${workspaceFolder}",
179-
"mainClass": "com.example.mongoes.TestMongoESApplication",
180-
"projectName": "boot-mongodb-elasticsearch",
181-
"args": "",
182-
"envFile": "${workspaceFolder}/.env"
18316
}
18417
]
18518
}
Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,42 @@
1-
services:
2-
3-
postgresqldb:
4-
image: postgres:17.2-alpine
5-
environment:
6-
- POSTGRES_USER=appuser
7-
- POSTGRES_PASSWORD=secret
8-
- POSTGRES_DB=appdb
9-
ports:
10-
- "5432:5432"
11-
1+
services:
2+
3+
postgresqldb:
4+
image: postgres:17.2-alpine
5+
hostname: postgresqldb
6+
extra_hosts: [ 'host.docker.internal:host-gateway' ]
7+
environment:
8+
- POSTGRES_USER=appuser
9+
- POSTGRES_PASSWORD=secret
10+
- POSTGRES_DB=appdb
11+
ports:
12+
- "5432:5432"
13+
networks:
14+
- boot-data-envers
15+
16+
pgadmin:
17+
image: dpage/pgadmin4
18+
extra_hosts: [ 'host.docker.internal:host-gateway' ]
19+
environment:
20+
- PGADMIN_DEFAULT_EMAIL=pgadmin4@pgadmin.org
21+
- PGADMIN_DEFAULT_PASSWORD=admin
22+
- PGADMIN_CONFIG_SERVER_MODE=False
23+
- PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False
24+
ports:
25+
- "5050:80"
26+
depends_on:
27+
postgresqldb:
28+
condition: service_started
29+
volumes:
30+
- ./docker_pgadmin_servers.json:/pgadmin4/servers.json
31+
entrypoint:
32+
- "/bin/sh"
33+
- "-c"
34+
- "/bin/echo 'postgresqldb:5432:*:appuser:secret' > /tmp/pgpassfile && chmod 600 /tmp/pgpassfile && /entrypoint.sh"
35+
restart: unless-stopped
36+
networks:
37+
- boot-data-envers
38+
39+
40+
networks:
41+
boot-data-envers:
42+
driver: bridge
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"Servers": {
3+
"1": {
4+
"Name": "Docker Compose DB",
5+
"Group": "Servers",
6+
"Port": 5432,
7+
"Username": "appuser",
8+
"Host": "postgresqldb",
9+
"SSLMode": "prefer",
10+
"MaintenanceDB": "appdb",
11+
"PassFile": "/tmp/pgpassfile"
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)