Skip to content

Connect to existing docker network

Let say you created network somewhere and you wanna spin up new container using the same network.

YAML
version: "3.7"

services:

  nginx:
    image: nginx
    networks:
      - ubuntu_default
    volumes:
      - ./download:/download
      - ./default.conf:/etc/nginx/conf.d/dafault.conf
    restart: always
    hostname: download-me

networks:
  ubuntu_default:
    name: ubuntu_default
    external: true