1
0
Fork 0

Remove version directive from all Docker Compose and Swarm configuration files.

- Eliminated the `version` field across various examples and documentation for simplicity and alignment with newer Docker Compose and Swarm standards.
- Updated relevant documentation and example usage instructions accordingly.
This commit is contained in:
Joao Gilberto Magalhaes 2025-12-04 09:25:05 -05:00
parent 99f4ff325b
commit 5397f0166e
20 changed files with 11 additions and 71 deletions

View file

@ -1,5 +1,3 @@
version: "3"
services: services:
easyhaproxy: easyhaproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0

View file

@ -69,8 +69,6 @@ docker run \
If you are using docker-compose you can use this way: If you are using docker-compose you can use this way:
```yaml ```yaml
version: "3"
services: services:
mycontainer: mycontainer:
image: some/myimage image: some/myimage
@ -102,8 +100,6 @@ EasyHAProxy supports FastCGI protocol for PHP-FPM and other FastCGI applications
#### Using Unix Socket #### Using Unix Socket
```yaml title="PHP-FPM with Unix socket" ```yaml title="PHP-FPM with Unix socket"
version: "3"
services: services:
php-fpm: php-fpm:
image: php:8.2-fpm image: php:8.2-fpm
@ -119,8 +115,6 @@ services:
#### Using TCP Connection #### Using TCP Connection
```yaml title="PHP-FPM with TCP connection" ```yaml title="PHP-FPM with TCP connection"
version: "3"
services: services:
php-fpm: php-fpm:
image: php:8.2-fpm image: php:8.2-fpm

View file

@ -31,8 +31,6 @@ docker network create -d overlay --attachable easyhaproxy
And then deploy the EasyHAProxy stack: And then deploy the EasyHAProxy stack:
```yaml ```yaml
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0
@ -76,8 +74,6 @@ Mapping to `/var/run/docker.sock` is necessary to discover the docker containers
To make your containers "discoverable" by EasyHAProxy, that is the minimum configuration you need: To make your containers "discoverable" by EasyHAProxy, that is the minimum configuration you need:
```yaml ```yaml
version: "3"
services: services:
container: container:
image: my/image:tag image: my/image:tag

View file

@ -172,6 +172,11 @@ curl -I -H "Host: google.helloworld.com" localhost:19901
- Running Portainer behind EasyHAProxy - Running Portainer behind EasyHAProxy
- Real-world application example - Real-world application example
**Usage:**
```bash
docker compose -f docker-compose-portainer.yml up -d
```
**Access Portainer:** **Access Portainer:**
- URL: http://portainer.local (add to `/etc/hosts` or use real DNS) - URL: http://portainer.local (add to `/etc/hosts` or use real DNS)
- First time: Create admin user - First time: Create admin user
@ -184,6 +189,11 @@ curl -I -H "Host: google.helloworld.com" localhost:19901
- Multiple applications behind EasyHAProxy - Multiple applications behind EasyHAProxy
- Portainer + custom app setup - Portainer + custom app setup
**Usage:**
```bash
docker compose -f docker-compose-portainer-app-example.yml up -d
```
--- ---
## Plugin Examples ## Plugin Examples
@ -212,8 +222,6 @@ Run PHP applications with FastCGI protocol support:
**Configuration:** **Configuration:**
```yaml ```yaml
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0
@ -304,8 +312,6 @@ The `php-app/` directory contains:
Protect your API with JWT token validation: Protect your API with JWT token validation:
```yaml ```yaml
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0
@ -370,8 +376,6 @@ openssl rsa -in jwt_private.pem -pubout -out jwt_pubkey.pem
Restore original visitor IPs when using Cloudflare CDN: Restore original visitor IPs when using Cloudflare CDN:
```yaml ```yaml
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0
@ -413,8 +417,6 @@ curl https://www.cloudflare.com/ips-v6 >> cloudflare_ips.lst
Restrict access to specific IP addresses: Restrict access to specific IP addresses:
```yaml ```yaml
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0
@ -460,8 +462,6 @@ curl http://admin.example.com
Combine multiple plugins for enhanced security: Combine multiple plugins for enhanced security:
```yaml ```yaml
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0

View file

@ -4,8 +4,6 @@
# - public IP pointing your machine # - public IP pointing your machine
# - open ports 80 and 443 in your firewall # - open ports 80 and 443 in your firewall
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0

View file

@ -4,8 +4,6 @@
# or add to /etc/hosts # or add to /etc/hosts
# 127.0.0.1 host1.local # 127.0.0.1 host1.local
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0

View file

@ -24,8 +24,6 @@
# Without Cloudflare, the request won't come from Cloudflare IPs, so the plugin # Without Cloudflare, the request won't come from Cloudflare IPs, so the plugin
# won't activate. This example is for demonstration and testing purposes. # won't activate. This example is for demonstration and testing purposes.
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0

View file

@ -19,8 +19,6 @@
# #
# Note: Update the allowed_ips label with your actual IP addresses/networks # Note: Update the allowed_ips label with your actual IP addresses/networks
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0

View file

@ -27,8 +27,6 @@
# curl -H "Authorization: Bearer $TOKEN" http://api.local/ # curl -H "Authorization: Bearer $TOKEN" http://api.local/
# # Response: Success # # Response: Success
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0

View file

@ -7,8 +7,6 @@
# content-length: 0 # content-length: 0
# location: www.google.com/ # location: www.google.com/
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0

View file

@ -21,8 +21,6 @@
# - PATH_INFO support for routing # - PATH_INFO support for routing
# - Custom FastCGI parameters # - Custom FastCGI parameters
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0

View file

@ -29,8 +29,6 @@
# # Admin panel (IP whitelist only) # # Admin panel (IP whitelist only)
# curl http://admin.local/ # Success from localhost # curl http://admin.local/ # Success from localhost
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0

View file

@ -1,5 +1,3 @@
version: "3"
services: services:
container: container:
image: byjg/static-httpserver image: byjg/static-httpserver

View file

@ -4,8 +4,6 @@
# docker network create easyhaproxy # docker network create easyhaproxy
version: "3"
services: services:
easyhaproxy: easyhaproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0

View file

@ -15,8 +15,6 @@
# Test SSL: # Test SSL:
# openssl s_client -showcerts -connect 127.0.0.1:443 -servername host1.local # openssl s_client -showcerts -connect 127.0.0.1:443 -servername host1.local
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0

View file

@ -1,8 +1,6 @@
# To test: # To test:
# curl -k -H "Host: host1.local" https://127.0.0.1/ # curl -k -H "Host: host1.local" https://127.0.0.1/
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0

View file

@ -104,8 +104,6 @@ docker stack deploy -c portainer.yml portainer
### easyhaproxy.yml ### easyhaproxy.yml
```yaml ```yaml
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0
@ -152,8 +150,6 @@ Service labels are similar to container labels but applied to **services**, not
### Basic Service Example ### Basic Service Example
```yaml ```yaml
version: "3"
services: services:
webapp: webapp:
image: nginx:alpine image: nginx:alpine
@ -188,8 +184,6 @@ labels:
### Use Case 1: Simple HTTP Service ### Use Case 1: Simple HTTP Service
```yaml ```yaml
version: "3"
services: services:
myapp: myapp:
image: my-app:latest image: my-app:latest
@ -215,8 +209,6 @@ docker stack deploy -c myapp.yml myapp
### Use Case 2: HTTPS with Let's Encrypt ### Use Case 2: HTTPS with Let's Encrypt
```yaml ```yaml
version: "3"
services: services:
secure-app: secure-app:
image: secure-app:latest image: secure-app:latest
@ -296,8 +288,6 @@ services:
### Use Case 5: Multiple Services with Load Balancing ### Use Case 5: Multiple Services with Load Balancing
```yaml ```yaml
version: "3"
services: services:
frontend: frontend:
image: frontend-app:latest image: frontend-app:latest
@ -349,8 +339,6 @@ networks:
Secure your API with JWT token validation in Swarm: Secure your API with JWT token validation in Swarm:
```yaml ```yaml
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0
@ -421,8 +409,6 @@ curl -H "Authorization: Bearer eyJhbGc..." http://api.example.com/users
Restore original visitor IPs in Swarm environment: Restore original visitor IPs in Swarm environment:
```yaml ```yaml
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0
@ -480,8 +466,6 @@ docker stack deploy -c cloudflare-stack.yml myapp
Restrict admin panel to specific IPs in Swarm: Restrict admin panel to specific IPs in Swarm:
```yaml ```yaml
version: "3"
services: services:
admin: admin:
image: admin-panel:latest image: admin-panel:latest
@ -522,8 +506,6 @@ curl http://admin.example.com
Production-ready setup with multiple security layers: Production-ready setup with multiple security layers:
```yaml ```yaml
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0
@ -750,7 +732,7 @@ Place certificate files:
docker secret create example_com_cert ./example.com.pem docker secret create example_com_cert ./example.com.pem
# Use in stack # Use in stack
version: "3"
services: services:
haproxy: haproxy:
secrets: secrets:

View file

@ -3,8 +3,6 @@
# docker stack deploy -c easyhaproxy.yml easyhaproxy # docker stack deploy -c easyhaproxy.yml easyhaproxy
version: "3"
services: services:
haproxy: haproxy:
image: byjg/easy-haproxy:4.6.0 image: byjg/easy-haproxy:4.6.0

View file

@ -1,8 +1,6 @@
# To install: # To install:
# docker stack deploy -c portainer.yml portainer # docker stack deploy -c portainer.yml portainer
version: "3"
services: services:
portainer: portainer:
image: portainer/portainer-ce:latest image: portainer/portainer-ce:latest

View file

@ -18,8 +18,6 @@
# Test SSL: # Test SSL:
# openssl s_client -showcerts -connect 127.0.0.1:443 -servername host1.local # openssl s_client -showcerts -connect 127.0.0.1:443 -servername host1.local
version: "3"
services: services:
container: container:
image: byjg/static-httpserver image: byjg/static-httpserver