Skip to content

Commit f1fd2d9

Browse files
Update docker-pad.md
1 parent f846f45 commit f1fd2d9

1 file changed

Lines changed: 51 additions & 46 deletions

File tree

content/en/docs/deployment/docker-deploy/docker-pad.md

Lines changed: 51 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ These endpoints are especially useful when integrating with orchestration platfo
241241
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.
242242

243243
{{% 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.
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.
245245
{{% /alert %}}
246246

247247
### Configuring Nginx
@@ -250,7 +250,7 @@ To configure Nginx, perform the following steps:
250250

251251
1. Define services for the app and Nginx reverse proxy:
252252

253-
```
253+
```text
254254
services:
255255
app:
256256
build: .
@@ -271,7 +271,7 @@ To configure Nginx, perform the following steps:
271271
2. Run the following command: `docker-compose up --build`.​
272272
3. Create the following `nginx.conf` file to proxy requests to the app:
273273

274-
```
274+
```text
275275
events {}
276276
http {
277277
server {
@@ -297,7 +297,7 @@ Traefik uses two networks: *frontend* (public) and *backend* (internal).
297297

298298
1. Add Traefik labels to the app service:
299299

300-
```
300+
```text
301301
services:
302302
traefik:
303303
image: traefik:v3.0
@@ -355,52 +355,57 @@ This section explains how Traefik proxies differ from Nginx.
355355
* A dashboard available at `http://localhost:8080` shows the routes.
356356
* You can easily scale by duplicating the `app service` with unique router rules (for example, `Host(app2.local)`).​
357357

358-
## High Availability (sample)
358+
## Example High Availability Implementation
359359

360-
High availability requires redundancy, health checks, and restarts to handle failures. Scale for HA with Docker Compose (for local/dev) or Kubernetes:
361-
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.
362-
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.
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.
363361

364-
**docker-compose.yml:**
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.
365363

366-
```
367-
services:
368-
myapp:
369-
image: myapp
370-
ports:
371-
- "8080:8080"
372-
deploy:
373-
replicas: 3 # Run 3 instances
374-
healthcheck:
375-
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/actuator/health"]
376-
interval: 30s
377-
timeout: 10s
378-
retries: 3
379-
```
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 %}}
380367

381-
Start with 'docker-compose up --scale myapp=3'.
368+
1. Configure the *docker-compose.yml* as in the following example:
382369

383-
Add a load balancer like Traefik or NGINX reverse proxy in front:
384-
```
385-
services:
386-
traefik:
387-
image: traefik:v3.0
388-
command: --providers.docker --entrypoints.web.address=:80
389-
ports: ["80:80"]
390-
myapp:
391-
# No ports exposed; Traefik load balances
392-
```
393-
This creates redundancy—kill one container, and traffic shifts automatically.
370+
```text
371+
services:
372+
myapp:
373+
image: myapp
374+
ports:
375+
- "8080:8080"
376+
deploy:
377+
replicas: 3 # Run 3 instances
378+
healthcheck:
379+
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/actuator/health"]
380+
interval: 30s
381+
timeout: 10s
382+
retries: 3
383+
```
394384

395-
**Manual Build and Run**
385+
2. Start the process by running the following command: `docker-compose up --scale myapp=3`.
386+
3. Add a load balancer like Traefik or an NGINX reverse proxy in the front:
396387

397-
```
398-
# Build image
399-
docker build -t myapp:latest .
400-
# Test single instance
401-
docker run -p 8080:8080 myapp:latest
402-
# For HA: Run 3 replicas (use docker-compose.yml for production)
403-
docker run -d -p 8081:8080 --name app1 myapp:latest
404-
docker run -d -p 8082:8080 --name app2 myapp:latest
405-
docker run -d -p 8083:8080 --name app3 myapp:latest
406-
```
388+
``` text
389+
services:
390+
traefik:
391+
image: traefik:v3.0
392+
command: --providers.docker --entrypoints.web.address=:80
393+
ports: ["80:80"]
394+
myapp:
395+
# No ports exposed; Traefik load balances
396+
```
397+
398+
This creates a redundancy—kill container, and traffic shifts automatically.
399+
400+
4. Build and run manually by running the following script:
401+
402+
``` text
403+
# Build image
404+
docker build -t myapp:latest .
405+
# Test single instance
406+
docker run -p 8080:8080 myapp:latest
407+
# For HA: Run 3 replicas (use docker-compose.yml for production)
408+
docker run -d -p 8081:8080 --name app1 myapp:latest
409+
docker run -d -p 8082:8080 --name app2 myapp:latest
410+
docker run -d -p 8083:8080 --name app3 myapp:latest
411+
```

0 commit comments

Comments
 (0)