Fully-Dockernized Spring WebMVC Development Environment
IDE for Spring provides all services and tools, based on Docker, to develop Spring WebMVC.
VSCode | Code Editor | 127.0.0.1:8081 |
WildFly | WAS | 127.0.0.1:8082 |
WildFly | Console | 127.0.0.1:8083 |
SpringWeb | WebApp | 127.0.0.1:8082/my-app |
PostgreSQL | DBMS | 127.0.0.1:5432 |
PGAdmin4 | Query Tool | 127.0.0.1:5433 |
Enjoy your programming!
- docker and docker-compose are required.
git clone --depth=1 https://github.com/hongroklim/ide-for-spring.git
cd ide-for-spring
docker-compose up -d
- Access 127.0.0.1:8081
- Enter password (
mycdrpassword
default) File
>Open Workspace
and choose~/my-app
- (Optional)
Extensions
>Search
and installJava Extension Pack
File
>Maven Projects
>my-app
right-click thendeploy
- (See) WildFly Maven Plugin
Debug
>Debug WildFly
and start
- Access 127.0.0.1:8083
- Login (
myname
andmywildflypassword
default) - (See) WildFly Admin Guide
- Access 127.0.0.1:5433
- Login (
myname
andmypgapassword
default) Server
>Create
and create the connection
- Address:
172.18.0.12
- Port:
5432
- DB:
db_psql
- USER:
usr_psql
- PASSWORD:
mypsqlpassword
It contains Openjdk 8
, Openjdk 11
and Maven
. Install VSCode extensions
in your preferences. (e.g. Java Extension Pack, XML and lombok)
All configurations are assigned with default values. They can be modifed as well as added.
./.env
Usernames and passwords of the services.
./docker-compose.yml
Mount directory, external ports and IP address of intranet.
./wildfly/standalone.xml
WildFly configurations.
./psql/init.sh
Initialize PostgreSQL with a script (e.g. dump or schema).
If you have very limited ports (e.g. 80
only in cloud server), NGINX can
solve this problem.
# Install NGINX
$ sudo apt-get update
$ sudo apt-get install nginx
# Start Up
$ sudo service nginx start
# /etc/nginx/conf.d/default.d
server {
listen [::]:80;
server_name localhost
# code-server
location /code-server/ {
proxy_set_header X-Script-Name /code-server;
proxy_set_header Host $host;
# web socket conf
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://127.0.0.1:8081/;
proxy_redirect off;
proxy_http_version 1.1;
}
# wildfly
location /wildfly/ {
proxy_set_header X-Script-Name /wildfly;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8082/;
proxy_redirect off;
}
# WildFly Console
location /wildfly-admin/ {
proxy_set_header X-Script-Name /wildfly-admin;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8083/;
proxy_redirect off;
}
# pgadmin4
location /pgadmin4/ {
proxy_set_header X-Script-Name /pgadmin4;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:5433/;
proxy_redirect off;
}
}
# Restart
$ sudo service nginx restart
Now you can access all services in 80 port distinguished by subpath
(e.g. /code-server
, /wildfly
and /pgadmin4
)