From 2b5326e7b7b97bf41bcb6bbc5376bb3cf85f6e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Serrador?= <61971372+mruiserrmendix@users.noreply.github.com> Date: Wed, 13 May 2026 10:23:44 +0200 Subject: [PATCH 1/4] Enhance Docker deployment documentation with proxy setups Added sections on configuring reverse proxies with Nginx and Traefik, including example configurations and key differences. Included high availability setup with Docker Compose and manual build instructions. --- .../deployment/docker-deploy/docker-pad.md | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) diff --git a/content/en/docs/deployment/docker-deploy/docker-pad.md b/content/en/docs/deployment/docker-deploy/docker-pad.md index 8b64bcaaa6c..51083a58342 100644 --- a/content/en/docs/deployment/docker-deploy/docker-pad.md +++ b/content/en/docs/deployment/docker-deploy/docker-pad.md @@ -235,3 +235,165 @@ The Mendix Runtime exposes health check endpoints that can be used to monitor th | `/health/ready` | Returns the readiness status — indicates if the app is ready to serve traffic | These endpoints are especially useful when integrating with orchestration platforms such as Kubernetes, which rely on liveness and readiness probes to manage container lifecycle. + +## Reverse Proxy + +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 appropriate settings will vary depending on your specific network environment and infrastructure setup. +Please note that this example implementation is provided "as-is" and is not covered under official support. Support requests related to this specific configuration cannot be addressed. + +### Nginx Configuration + +Define services for the app and Nginx reverse proxy. + +``` +services: + app: + build: . + ports: + - "127.0.0.1:8080:8080" # Bind only localhost + environment: + - SPRING_PROFILES_ACTIVE=docker + nginx: + image: nginx:alpine + ports: + - "80:80" + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf:ro + depends_on: + - app +``` + +Run with `docker-compose up --build`.​ + +Create `nginx.conf` for proxying requests to the app. + +``` +events {} +http { + server { + listen 80; + location / { + proxy_pass http://app:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } +} +``` + +This setup exposes only port 80 publicly while proxying to your app on internal port 8080. + +### Traefik configuration + +To set up Traefik as a reverse proxy for your app running in a Docker container, use Docker Compose for simplicity. This configuration exposes Traefik on ports 80/8080, automatically discovers your app container via labels, and routes traffic to it. +Traefik uses two networks: frontend (public) and backend (internal). Add Traefik labels to the app service. + +``` +services: + traefik: + image: traefik:v3.0 + ports: + - "80:80" + - "8080:8080" # Traefik dashboard + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + command: + - --api.dashboard=true + - --providers.docker=true + - --providers.docker.exposedbydefault=false + - --entrypoints.web.address=:80 + networks: + - frontend + - backend + restart: unless-stopped + app: + build: . + networks: + - backend + labels: + - traefik.enable=true + - traefik.docker.network=backend + - traefik.http.routers.app.rule=Host(`localhost`) || PathPrefix(`/api`) + - traefik.http.routers.app.entrypoints=web + - traefik.http.services.app.loadbalancer.server.port=8080 + restart: unless-stopped +networks: + frontend: + external: false + backend: + external: false +``` +Run with `docker compose up -d --build`. + +Access your app at `http://localhost` (Traefik proxies to app:8080 internally). + +**Key Traefik Labels Explained** + +`traefik.enable=true`: Enables Traefik for this container. + +`traefik.http.routers.java-app.rule=Host(yourapp.example.com)`: Routes requests matching the host to this service. + +`traefik.http.services.java-app.loadbalancer.server.port=8080`: Forwards to your app's internal port. + +Traefik auto-detects changes via Docker socket; no restarts needed for label updates. + +**Key Differences from Nginx** + +No static config files—Traefik auto-configures via labels. + +Dashboard at `http://localhost:8080` shows routes. + +Scale easily: duplicate `app service` with unique router rules (e.g., Host(app2.local)).​ + + +## High Availability (sample) + +High availability requires redundancy, health checks, and restarts to handle failures. Scale for HA with Docker Compose (for local/dev) or Kubernetes: +Again, 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 appropriate settings will vary depending on your specific network environment and infrastructure setup. +Please note that this example implementation is provided "as-is" and is not covered under official support. Support requests related to this specific configuration cannot be addressed. + +**docker-compose.yml:** + +``` +services: + myapp: + image: myapp + ports: + - "8080:8080" + deploy: + replicas: 3 # Run 3 instances + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/actuator/health"] + interval: 30s + timeout: 10s + retries: 3 +``` + +Start with 'docker-compose up --scale myapp=3'. + +Add a load balancer like Traefik or NGINX reverse proxy in front: +``` +services: + traefik: + image: traefik:v3.0 + command: --providers.docker --entrypoints.web.address=:80 + ports: ["80:80"] + myapp: + # No ports exposed; Traefik load balances +``` +This creates redundancy—kill one container, and traffic shifts automatically. + +**Manual Build and Run** + +``` +# Build image +docker build -t myapp:latest . +# Test single instance +docker run -p 8080:8080 myapp:latest +# For HA: Run 3 replicas (use docker-compose.yml for production) +docker run -d -p 8081:8080 --name app1 myapp:latest +docker run -d -p 8082:8080 --name app2 myapp:latest +docker run -d -p 8083:8080 --name app3 myapp:latest +``` From 284f17dcd44e3a1f71d652605b4601274d070464 Mon Sep 17 00:00:00 2001 From: katarzyna-koltun-mx <108737161+katarzyna-koltun-mx@users.noreply.github.com> Date: Wed, 13 May 2026 16:49:12 +0200 Subject: [PATCH 2/4] Refine reverse proxy and Traefik configuration sections Updated the reverse proxy section for clarity and added an alert box for the example implementation note. Changed 'Traefik configuration' to 'Traefik Configuration' for consistency. --- content/en/docs/deployment/docker-deploy/docker-pad.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/content/en/docs/deployment/docker-deploy/docker-pad.md b/content/en/docs/deployment/docker-deploy/docker-pad.md index 51083a58342..ce6e718936d 100644 --- a/content/en/docs/deployment/docker-deploy/docker-pad.md +++ b/content/en/docs/deployment/docker-deploy/docker-pad.md @@ -238,8 +238,11 @@ These endpoints are especially useful when integrating with orchestration platfo ## Reverse Proxy -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 appropriate settings will vary depending on your specific network environment and infrastructure setup. -Please note that this example implementation is provided "as-is" and is not covered under official support. Support requests related to this specific configuration cannot be addressed. +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. + +{{% alert color="info" %}} +This example implementation is provided "as-is" and is not covered under official support. Support requests related to this specific configuration cannot be addressed. +{{% /alert %}} ### Nginx Configuration @@ -285,7 +288,7 @@ http { This setup exposes only port 80 publicly while proxying to your app on internal port 8080. -### Traefik configuration +### Traefik Configuration To set up Traefik as a reverse proxy for your app running in a Docker container, use Docker Compose for simplicity. This configuration exposes Traefik on ports 80/8080, automatically discovers your app container via labels, and routes traffic to it. Traefik uses two networks: frontend (public) and backend (internal). Add Traefik labels to the app service. @@ -347,7 +350,6 @@ Dashboard at `http://localhost:8080` shows routes. Scale easily: duplicate `app service` with unique router rules (e.g., Host(app2.local)).​ - ## High Availability (sample) High availability requires redundancy, health checks, and restarts to handle failures. Scale for HA with Docker Compose (for local/dev) or Kubernetes: From 386965b8bbce07c2978e7b7dede12a0dca663873 Mon Sep 17 00:00:00 2001 From: katarzyna-koltun-mx <108737161+katarzyna-koltun-mx@users.noreply.github.com> Date: Wed, 13 May 2026 17:05:16 +0200 Subject: [PATCH 3/4] Update docker-pad.md --- .../deployment/docker-deploy/docker-pad.md | 73 ++++++++++--------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/content/en/docs/deployment/docker-deploy/docker-pad.md b/content/en/docs/deployment/docker-deploy/docker-pad.md index ce6e718936d..1865f4943bc 100644 --- a/content/en/docs/deployment/docker-deploy/docker-pad.md +++ b/content/en/docs/deployment/docker-deploy/docker-pad.md @@ -244,49 +244,50 @@ This section serves as a reference guide and starting point for configuring a re This example implementation is provided "as-is" and is not covered under official support. Support requests related to this specific configuration cannot be addressed. {{% /alert %}} -### Nginx Configuration +### Configuring Nginx -Define services for the app and Nginx reverse proxy. +To configure Nginx, perform the following steps: -``` -services: - app: - build: . - ports: - - "127.0.0.1:8080:8080" # Bind only localhost - environment: - - SPRING_PROFILES_ACTIVE=docker - nginx: - image: nginx:alpine - ports: - - "80:80" - volumes: - - ./nginx.conf:/etc/nginx/nginx.conf:ro - depends_on: - - app -``` +1. Define services for the app and Nginx reverse proxy: -Run with `docker-compose up --build`.​ + ``` + services: + app: + build: . + ports: + - "127.0.0.1:8080:8080" # Bind only localhost + environment: + - SPRING_PROFILES_ACTIVE=docker + nginx: + image: nginx:alpine + ports: + - "80:80" + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf:ro + depends_on: + - app + ``` -Create `nginx.conf` for proxying requests to the app. +2. Run the following command: `docker-compose up --build`.​ +3. Create the following `nginx.conf` file to proxy requests to the app: -``` -events {} -http { - server { - listen 80; - location / { - proxy_pass http://app:8080; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; + ``` + events {} + http { + server { + listen 80; + location / { + proxy_pass http://app:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } } - } -} -``` + ``` -This setup exposes only port 80 publicly while proxying to your app on internal port 8080. +This configuration exposes only port 80 publicly while acting as a proxy to your app on the internal port 8080. ### Traefik Configuration From f846f4537059b99f37335f635fa02e8a783dcb41 Mon Sep 17 00:00:00 2001 From: katarzyna-koltun-mx <108737161+katarzyna-koltun-mx@users.noreply.github.com> Date: Wed, 13 May 2026 19:15:26 +0200 Subject: [PATCH 4/4] Update docker-pad.md --- .../deployment/docker-deploy/docker-pad.md | 102 +++++++++--------- 1 file changed, 53 insertions(+), 49 deletions(-) diff --git a/content/en/docs/deployment/docker-deploy/docker-pad.md b/content/en/docs/deployment/docker-deploy/docker-pad.md index 1865f4943bc..f0b94c81305 100644 --- a/content/en/docs/deployment/docker-deploy/docker-pad.md +++ b/content/en/docs/deployment/docker-deploy/docker-pad.md @@ -289,67 +289,71 @@ To configure Nginx, perform the following steps: This configuration exposes only port 80 publicly while acting as a proxy to your app on the internal port 8080. -### Traefik Configuration +### Configuring Traefik -To set up Traefik as a reverse proxy for your app running in a Docker container, use Docker Compose for simplicity. This configuration exposes Traefik on ports 80/8080, automatically discovers your app container via labels, and routes traffic to it. -Traefik uses two networks: frontend (public) and backend (internal). Add Traefik labels to the app service. +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. -``` -services: - traefik: - image: traefik:v3.0 - ports: - - "80:80" - - "8080:8080" # Traefik dashboard - volumes: - - /var/run/docker.sock:/var/run/docker.sock:ro - command: - - --api.dashboard=true - - --providers.docker=true - - --providers.docker.exposedbydefault=false - - --entrypoints.web.address=:80 - networks: - - frontend - - backend - restart: unless-stopped - app: - build: . - networks: - - backend - labels: - - traefik.enable=true - - traefik.docker.network=backend - - traefik.http.routers.app.rule=Host(`localhost`) || PathPrefix(`/api`) - - traefik.http.routers.app.entrypoints=web - - traefik.http.services.app.loadbalancer.server.port=8080 - restart: unless-stopped -networks: - frontend: - external: false - backend: - external: false -``` -Run with `docker compose up -d --build`. +Traefik uses two networks: *frontend* (public) and *backend* (internal). + +1. Add Traefik labels to the app service: -Access your app at `http://localhost` (Traefik proxies to app:8080 internally). + ``` + services: + traefik: + image: traefik:v3.0 + ports: + - "80:80" + - "8080:8080" # Traefik dashboard + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + command: + - --api.dashboard=true + - --providers.docker=true + - --providers.docker.exposedbydefault=false + - --entrypoints.web.address=:80 + networks: + - frontend + - backend + restart: unless-stopped + app: + build: . + networks: + - backend + labels: + - traefik.enable=true + - traefik.docker.network=backend + - traefik.http.routers.app.rule=Host(`localhost`) || PathPrefix(`/api`) + - traefik.http.routers.app.entrypoints=web + - traefik.http.services.app.loadbalancer.server.port=8080 + restart: unless-stopped + networks: + frontend: + external: false + backend: + external: false + ``` -**Key Traefik Labels Explained** +2. Run the following command: `docker compose up -d --build`. -`traefik.enable=true`: Enables Traefik for this container. +You can now access your app at `http://localhost`. Traefik proxies to `app:8080` internally. -`traefik.http.routers.java-app.rule=Host(yourapp.example.com)`: Routes requests matching the host to this service. +#### Key Traefik Labels Explained -`traefik.http.services.java-app.loadbalancer.server.port=8080`: Forwards to your app's internal port. +This section explains the main labels used by Traefik. -Traefik auto-detects changes via Docker socket; no restarts needed for label updates. +* `traefik.enable=true` - Enables Traefik for this container. +* `traefik.http.routers.java-app.rule=Host(yourapp.example.com)` - Routes requests matching the host to this service. +* `traefik.http.services.java-app.loadbalancer.server.port=8080` - Forwards to your app's internal port. -**Key Differences from Nginx** +Traefik automatically detects changes through a Docker socket. You do not need to restart it to update the labels. -No static config files—Traefik auto-configures via labels. +#### Main Differences between Traefik and Nginx -Dashboard at `http://localhost:8080` shows routes. +This section explains how Traefik proxies differ from Nginx. -Scale easily: duplicate `app service` with unique router rules (e.g., Host(app2.local)).​ +* Traefik does not use static config files. Instead, the configuration is automatic through the use of labels. +* A dashboard available at `http://localhost:8080` shows the routes. +* You can easily scale by duplicating the `app service` with unique router rules (for example, `Host(app2.local)`).​ ## High Availability (sample)