docker - compose ipv 4 설정

1289 단어
docker-compose.yml
version: "3"
services:
  web: #      
    image: nginx
    volumes: #      
      - /Users/Documents/www:/usr/share/nginx/html:ro #   :docker:    ,www  
      - ./config/web.conf:/etc/nginx/nginx.conf:ro # nginx    
    ports: #        :docker
      - "8080:80"
      - "8081:81"
    # environment:
    # - NGINX_HOST=foobar.com
    # - NGINX_PORT=80
    # command: /bin/bash -c "envsubst < /etc/nginx/conf.d/mysite.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
    networks: ##     
      nn: ##         
        ipv4_address: 192.168.5.101 ## ipv4 ip  

  web8082:
    image: nginx
    volumes:
      - /Users/cai/Documents/www/8082:/usr/share/nginx/html:ro
    ports:
      - "8082:80"

    networks:
      nn:
        ipv4_address: 192.168.5.102

  web8083:
    image: nginx
    volumes:
      - /Users/cai/Documents/www/8083:/usr/share/nginx/html:ro
    ports:
      - "8083:80"

    networks:
      nn:
        ipv4_address: 192.168.5.103

networks: ##     
  nn: ##      
    driver: bridge ##      
    ipam: ##     
      driver: default
      config:
        - subnet: 192.168.5.0/24 ## ip                   192.168.5.1,          1

좋은 웹페이지 즐겨찾기