Код IT
← Каталог

Docker Compose — готовые стеки — 11. Nginx как reverse proxy

Фрагмент из «Docker Compose — готовые стеки»: 11. Nginx как reverse proxy.

YAML part-01.yaml
services:
  proxy:
    image: nginx:1.27-alpine
    ports:
      - "8080:80"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    depends_on:
      - frontend
      - api

  frontend:
    image: nginx:1.27-alpine
    volumes:
      - ./frontend:/usr/share/nginx/html:ro

  api:
    image: hashicorp/http-echo:1.0
    command: ["-text=API OK"]
services:
  proxy:
    image: nginx:1.27-alpine
    ports:
      - "8080:80"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    depends_on:
      - frontend
      - api

  frontend:
    image: nginx:1.27-alpine
    volumes:
      - ./frontend:/usr/share/nginx/html:ro

  api:
    image: hashicorp/http-echo:1.0
    command: ["-text=API OK"]