mirror of
https://github.com/booklore-app/booklore.git
synced 2025-12-23 22:28:11 -05:00
Enable java remote debug on dev docker stack (#1808)
* Enable java remote debug on dev stack * Enable java remote debug on dev stack * Update docs with info on docker development stack * Update dev docs
This commit is contained in:
@@ -41,10 +41,24 @@ ## 🚀 Getting Started
|
|||||||
|
|
||||||
## 🧱 Local Development Setup
|
## 🧱 Local Development Setup
|
||||||
|
|
||||||
Either run `docker compose -f dev.docker-compose.yml up` or install & run everything Locally (described below).
|
Booklore has a simple all-in-one Docker development stack, or you can install & run everything manually.
|
||||||
|
|
||||||
|
|
||||||
### 1. Prerequisites
|
### Development using Docker stack
|
||||||
|
|
||||||
|
Run `docker compose -f dev.docker-compose.yml up`
|
||||||
|
|
||||||
|
- Dev web server is accessible at `http://localhost:4200/`
|
||||||
|
- Dev database is accessible at `http://localhost:3366/`
|
||||||
|
- Remote java debugging is accessible at `http://localhost:5005/`
|
||||||
|
|
||||||
|
All ports are configurable using environment variables - see dev.docker-compose.yml
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Development on local machine
|
||||||
|
|
||||||
|
#### 1. Prerequisites
|
||||||
|
|
||||||
- **Java 21+**
|
- **Java 21+**
|
||||||
- **Node.js 18+**
|
- **Node.js 18+**
|
||||||
@@ -53,7 +67,7 @@ ### 1. Prerequisites
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 2. Frontend Setup
|
#### 2. Frontend Setup
|
||||||
|
|
||||||
To set up the Angular frontend:
|
To set up the Angular frontend:
|
||||||
|
|
||||||
@@ -69,9 +83,9 @@ ### 2. Frontend Setup
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 3. Backend Setup
|
#### 3. Backend Setup
|
||||||
|
|
||||||
#### a. Configure `application-dev.yml`
|
##### a. Configure `application-dev.yml`
|
||||||
|
|
||||||
Create or edit `booklore-api/src/main/resources/application-dev.yml`:
|
Create or edit `booklore-api/src/main/resources/application-dev.yml`:
|
||||||
|
|
||||||
@@ -90,7 +104,7 @@ #### a. Configure `application-dev.yml`
|
|||||||
|
|
||||||
> 🔧 Replace `/path/to/...` with actual local paths
|
> 🔧 Replace `/path/to/...` with actual local paths
|
||||||
|
|
||||||
#### b. Run the Backend
|
##### b. Run the Backend
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd booklore-api
|
cd booklore-api
|
||||||
|
|||||||
@@ -94,3 +94,9 @@ test {
|
|||||||
jvmArgs("-XX:+EnableDynamicAgentLoading")
|
jvmArgs("-XX:+EnableDynamicAgentLoading")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bootRun {
|
||||||
|
def debug = System.getenv('REMOTE_DEBUG_ENABLED')
|
||||||
|
if (debug.equals("true")) {
|
||||||
|
jvmArgs("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,10 +4,12 @@ services:
|
|||||||
command: sh -c "cd /booklore-api && ./gradlew bootRun"
|
command: sh -c "cd /booklore-api && ./gradlew bootRun"
|
||||||
ports:
|
ports:
|
||||||
- "${BACKEND_PORT:-8080}:8080"
|
- "${BACKEND_PORT:-8080}:8080"
|
||||||
|
- "${REMOTE_DEBUG_PORT:-5005}:5005"
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=jdbc:mariadb://backend_db:3306/booklore
|
- DATABASE_URL=jdbc:mariadb://backend_db:3306/booklore
|
||||||
- DATABASE_USERNAME=booklore
|
- DATABASE_USERNAME=booklore
|
||||||
- DATABASE_PASSWORD=booklore
|
- DATABASE_PASSWORD=booklore
|
||||||
|
- REMOTE_DEBUG_ENABLED=true
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
tty: true
|
tty: true
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@@ -29,6 +31,8 @@ services:
|
|||||||
- MYSQL_DATABASE=booklore
|
- MYSQL_DATABASE=booklore
|
||||||
- MYSQL_USER=booklore
|
- MYSQL_USER=booklore
|
||||||
- MYSQL_PASSWORD=booklore
|
- MYSQL_PASSWORD=booklore
|
||||||
|
ports:
|
||||||
|
- "${DB_PORT:-3366}:3306"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "mariadb-admin", "ping", "-h", "localhost", "-uroot", "-pbooklore" ]
|
test: [ "CMD", "mariadb-admin", "ping", "-h", "localhost", "-uroot", "-pbooklore" ]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
|
|||||||
Reference in New Issue
Block a user