You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+75-17Lines changed: 75 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,42 +50,83 @@ This command will:
50
50
51
51
## Docker Support
52
52
53
-
### Running Backend with Docker
53
+
### Running with Docker
54
54
55
-
The backend can be run in a Docker container for easy deployment and consistency across environments.
55
+
Both frontend and backend can be run in Docker containers for easy deployment and consistency across environments.
56
56
57
57
#### Using Docker Compose (Recommended)
58
58
59
59
```bash
60
-
# Build and start the backend
60
+
# Build and start both frontend and backend
61
61
docker-compose up --build
62
62
63
63
# Run in background
64
64
docker-compose up -d --build
65
65
66
-
# Stop the service
66
+
# Stop both services
67
67
docker-compose down
68
+
69
+
# Build and start only backend
70
+
docker-compose up backend --build
71
+
72
+
# Build and start only frontend
73
+
docker-compose up frontend --build
74
+
```
75
+
76
+
#### Development Docker Setup
77
+
78
+
For development with hot reload and backend URL input support:
79
+
80
+
```bash
81
+
# Start development containers
82
+
./start-dev.sh
83
+
84
+
# Or use just commands
85
+
just docker-dev # Start with logs
86
+
just docker-dev-bg # Start in background
87
+
just docker-dev-down # Stop containers
68
88
```
69
89
90
+
**Development Features:**
91
+
- Hot reload for both frontend and backend
92
+
- Backend URL input field enabled
93
+
- Separate ports (Frontend: 3000, Backend: 8080)
94
+
- Source code mounted as volumes
95
+
70
96
#### Using Docker Commands
71
97
98
+
**Backend:**
72
99
```bash
73
-
# Build the image
100
+
# Build the backend image
74
101
docker build -t ah-monitoring-backend ./backend
75
102
76
-
# Run the container
77
-
docker run -p 3000:3000 -v $(pwd)/backend/data:/app/data ah-monitoring-backend
103
+
# Run the backend container
104
+
docker run -p 8080:8080 -v $(pwd)/backend/data:/app/data ah-monitoring-backend
78
105
79
106
# Run in background
80
-
docker run -d -p 3000:3000 -v $(pwd)/backend/data:/app/data --name ah-backend ah-monitoring-backend
107
+
docker run -d -p 8080:8080 -v $(pwd)/backend/data:/app/data --name ah-backend ah-monitoring-backend
108
+
```
81
109
82
-
# Stop the container
83
-
docker stop ah-backend
110
+
**Frontend:**
111
+
```bash
112
+
# Build the frontend image
113
+
docker build -t ah-monitoring-frontend ./frontend
114
+
115
+
# Run the frontend container
116
+
docker run -p 3000:3000 ah-monitoring-frontend
117
+
118
+
# Run in background
119
+
docker run -d -p 3000:3000 --name ah-frontend ah-monitoring-frontend
120
+
121
+
# Stop containers
122
+
docker stop ah-backend ah-frontend
84
123
85
-
# Remove the container
86
-
docker rm ah-backend
124
+
# Remove containers
125
+
docker rm ah-backend ah-frontend
87
126
```
88
127
128
+
> **Note**: For production deployment, you'll need a reverse proxy (like nginx) to route `/` to the frontend container and `/api/*` to the backend container, since the production frontend uses relative URLs.
129
+
89
130
#### Environment Variables with Docker
90
131
91
132
You can pass environment variables to the Docker container:
@@ -139,19 +180,20 @@ The application consists of two parts:
139
180
The frontend connects to the backend via Server-Sent Events (SSE) at `/api/updates`.
140
181
141
182
**Dynamic Backend URL:**
142
-
- The frontend includes a backend URL input field in the header
183
+
- The frontend includes a backend URL input field in the header (development builds only)
143
184
- Users can connect to any backend instance by entering the URL
144
185
- Supports both local and remote backend instances
145
186
- Shows connection status (connected/disconnected)
146
187
- Defaults to `http://localhost:8080` in development
147
188
148
189
**Query Parameter Configuration:**
149
-
- You can also set the backend URL via query parameter: `?backend_url=http://your-backend:8080`
190
+
- You can set the backend URL via query parameter: `?backend_url=http://your-backend:8080`
0 commit comments