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: content/en/docs/deployment/docker-deploy/docker-pad.md
+174Lines changed: 174 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -235,3 +235,177 @@ The Mendix Runtime exposes health check endpoints that can be used to monitor th
235
235
| `/health/ready` | Returns the readiness status — indicates if the app is ready to serve traffic |
236
236
237
237
These endpoints are especially useful when integrating with orchestration platforms such as Kubernetes, which rely on liveness and readiness probes to manage container lifecycle.
238
+
239
+
## Reverse Proxy
240
+
241
+
This section serves as a reference guide and starting point for configuring a reverse proxy on Docker. The configurations provided are intended for illustrative purposes only, as the required settings vary depending on your specific network environment and infrastructure setup.
242
+
243
+
{{% alert color="info" %}}
244
+
This example implementation is provided as-is, and is not covered under official support. Support requests related to this specific configuration cannot be addressed.
245
+
{{% /alert %}}
246
+
247
+
### Configuring Nginx
248
+
249
+
To configure Nginx, perform the following steps:
250
+
251
+
1. Define services for the app and Nginx reverse proxy:
252
+
253
+
```text
254
+
services:
255
+
app:
256
+
build: .
257
+
ports:
258
+
- "127.0.0.1:8080:8080" # Bind only localhost
259
+
environment:
260
+
- SPRING_PROFILES_ACTIVE=docker
261
+
nginx:
262
+
image: nginx:alpine
263
+
ports:
264
+
- "80:80"
265
+
volumes:
266
+
- ./nginx.conf:/etc/nginx/nginx.conf:ro
267
+
depends_on:
268
+
- app
269
+
```
270
+
271
+
2. Run the following command: `docker-compose up --build`.
272
+
3. Create the following `nginx.conf` file to proxy requests to the app:
This configuration exposes only port 80 publicly while acting as a proxy to your app on the internal port 8080.
291
+
292
+
### Configuring Traefik
293
+
294
+
To simplify setting up Traefik as a reverse proxy for your app running in a Docker container, use Docker Compose. This configuration exposes Traefik on ports `80/8080`, automatically discovers your app container through labels, and routes traffic to it.
295
+
296
+
Traefik uses two networks: *frontend* (public) and *backend* (internal).
2. Run the following command: `docker compose up -d --build`.
337
+
338
+
You can now access your app at `http://localhost`. Traefik proxies to `app:8080` internally.
339
+
340
+
#### Key Traefik Labels Explained
341
+
342
+
This section explains the main labels used by Traefik.
343
+
344
+
* `traefik.enable=true` - Enables Traefik for this container.
345
+
* `traefik.http.routers.java-app.rule=Host(yourapp.example.com)` - Routes requests matching the host to this service.
346
+
* `traefik.http.services.java-app.loadbalancer.server.port=8080` - Forwards to your app's internal port.
347
+
348
+
Traefik automatically detects changes through a Docker socket. You do not need to restart it to update the labels.
349
+
350
+
#### Main Differences between Traefik and Nginx
351
+
352
+
This section explains how Traefik proxies differ from Nginx.
353
+
354
+
* Traefik does not use static config files. Instead, the configuration is automatic through the use of labels.
355
+
* A dashboard available at `http://localhost:8080` shows the routes.
356
+
* You can easily scale by duplicating the `app service` with unique router rules (for example, `Host(app2.local)`).
357
+
358
+
## Example High Availability Implementation
359
+
360
+
High availability (HA) requires redundancy, health checks, and restarts to handle failures. Scale for HA with Docker Compose (for local or development environments) or Kubernetes.
361
+
362
+
This section serves as a reference guide and starting point for configuring high availability on Docker. The configurations provided are intended for illustrative purposes only, as the settings will vary depending on your specific network environment and infrastructure setup.
363
+
364
+
{{% alert color="info" %}}
365
+
This example implementation is provided as-is, and is not covered under official support. Support requests related to this specific configuration cannot be addressed.
366
+
{{% /alert %}}
367
+
368
+
1. Configure the *docker-compose.yml* as in the following example:
0 commit comments