| 1 | version: "3" |
| 2 | networks: |
| 3 | mystack: |
| 4 | services: |
| 5 | web1: |
| 6 | image: busybox |
| 7 | hostname: web1 |
| 8 | command: ["/bin/busybox", "httpd", "-f", "-h", "/var/www/html", "-p", "8001"] |
| 9 | working_dir: /var/www/html |
| 10 | ports: |
| 11 | - 8001:8001 |
| 12 | volumes: |
| 13 | - ./test1.txt:/var/www/html/index.txt:ro,z |
| 14 | web2: |
| 15 | image: busybox |
| 16 | hostname: web2 |
| 17 | command: ["/bin/busybox", "httpd", "-f", "-h", "/var/www/html", "-p", "8001"] |
| 18 | working_dir: /var/www/html |
| 19 | ports: |
| 20 | - 8002:8001 |
| 21 | volumes: |
| 22 | - ./test2.txt:/var/www/html/index.txt:ro,z |
| 23 |