Multicontainer networking between containers

So I’m trying to connect two containers in both ways, one of them is a socket server with chat inside, so links or depends_on won’t work, I need the networks feature of docker compose.

The docker-compose file I’m using is:

version: '2'
services:
  socket_server:
    build: ./socket_server
    privileged: true
    ports:
      - "3333:3333"
    networks:
      main:
        aliases:
          - socket_server
  ruby_test:
    build: ./ruby_test
    privileged: true
    expose:
      - "3000"
    networks:
      main:
        aliases:
          - ruby_test
  nginx:
    build: ./nginx
    depends_on:
      - ruby_test
    ports:
      - "80:80"
networks:
  main: {}

_(I had to use the {} because it would throw the error: _
[Error] Could not parse compose file
[Error] data/networks/main should be object
[Error] Not deploying release.
)

If I leave the ruby and nginx only it build perfect. The only thing I need is to add a socket server container that will communicate bidirectionally with the rails container.

Also, I’m not even sure if the networks feature is supported by resin yet.

Any ideas, suggestions, corrections are welcome.

Have you tried not specifying networks at all? From my understanding of how Docker Compose works, services can communicate with each other out of the box. Just use the name of the service you want to talk to when requested to provide an IP address or hostname (reference = first paragraph of Networking in Compose).

Regarding what is supported by Resin, check out this link.

EDIT: this sounds related to your other post. It also appears you got everything working, right?

Indeed According to documentation I don’t need to specify a network, at least for what I try to achieve. I haven’t been able to test yet given I’m facing an error in the build, will come back and answer when I can test it.